libc.info-4 289 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034
  1. This is libc.info, produced by makeinfo version 7.3 from libc.texinfo.
  2. This is ‘The GNU C Library Reference Manual’, for version 2.43.
  3. Copyright © 1993-2026 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software Needs Free Documentation" and
  8. "GNU Lesser General Public License", the Front-Cover texts being "A GNU
  9. Manual", and with the Back-Cover Texts as in (a) below. A copy of the
  10. license is included in the section entitled "GNU Free Documentation
  11. License".
  12. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  13. modify this GNU manual. Buying copies from the FSF supports it in
  14. developing GNU and promoting software freedom."
  15. INFO-DIR-SECTION Software libraries
  16. START-INFO-DIR-ENTRY
  17. * Libc: (libc). C library.
  18. END-INFO-DIR-ENTRY
  19. INFO-DIR-SECTION GNU C library functions and macros
  20. START-INFO-DIR-ENTRY
  21. * ALTWERASE: (libc)Local Modes.
  22. * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
  23. * ARG_MAX: (libc)General Limits.
  24. * BAUD_MAX: (libc)Line Speed.
  25. * BC_BASE_MAX: (libc)Utility Limits.
  26. * BC_DIM_MAX: (libc)Utility Limits.
  27. * BC_SCALE_MAX: (libc)Utility Limits.
  28. * BC_STRING_MAX: (libc)Utility Limits.
  29. * BRKINT: (libc)Input Modes.
  30. * BUFSIZ: (libc)Controlling Buffering.
  31. * CCTS_OFLOW: (libc)Control Modes.
  32. * CHAR_BIT: (libc)Width of Type.
  33. * CHILD_MAX: (libc)General Limits.
  34. * CIGNORE: (libc)Control Modes.
  35. * CLK_TCK: (libc)Processor Time.
  36. * CLOCAL: (libc)Control Modes.
  37. * CLOCKS_PER_SEC: (libc)CPU Time.
  38. * CLOCK_BOOTTIME: (libc)Getting the Time.
  39. * CLOCK_BOOTTIME_ALARM: (libc)Getting the Time.
  40. * CLOCK_MONOTONIC: (libc)Getting the Time.
  41. * CLOCK_MONOTONIC_COARSE: (libc)Getting the Time.
  42. * CLOCK_MONOTONIC_RAW: (libc)Getting the Time.
  43. * CLOCK_PROCESS_CPUTIME_ID: (libc)Getting the Time.
  44. * CLOCK_REALTIME: (libc)Getting the Time.
  45. * CLOCK_REALTIME_ALARM: (libc)Getting the Time.
  46. * CLOCK_REALTIME_COARSE: (libc)Getting the Time.
  47. * CLOCK_TAI: (libc)Getting the Time.
  48. * CLOCK_THREAD_CPUTIME_ID: (libc)Getting the Time.
  49. * COLL_WEIGHTS_MAX: (libc)Utility Limits.
  50. * CPU_ALLOC: (libc)CPU Affinity.
  51. * CPU_ALLOC_SIZE: (libc)CPU Affinity.
  52. * CPU_AND: (libc)CPU Affinity.
  53. * CPU_AND_S: (libc)CPU Affinity.
  54. * CPU_CLR: (libc)CPU Affinity.
  55. * CPU_CLR_S: (libc)CPU Affinity.
  56. * CPU_COUNT: (libc)CPU Affinity.
  57. * CPU_COUNT_S: (libc)CPU Affinity.
  58. * CPU_EQUAL: (libc)CPU Affinity.
  59. * CPU_EQUAL_S: (libc)CPU Affinity.
  60. * CPU_FEATURE_ACTIVE: (libc)X86.
  61. * CPU_FEATURE_PRESENT: (libc)X86.
  62. * CPU_FREE: (libc)CPU Affinity.
  63. * CPU_ISSET: (libc)CPU Affinity.
  64. * CPU_ISSET_S: (libc)CPU Affinity.
  65. * CPU_OR: (libc)CPU Affinity.
  66. * CPU_OR_S: (libc)CPU Affinity.
  67. * CPU_SET: (libc)CPU Affinity.
  68. * CPU_SETSIZE: (libc)CPU Affinity.
  69. * CPU_SET_S: (libc)CPU Affinity.
  70. * CPU_XOR: (libc)CPU Affinity.
  71. * CPU_XOR_S: (libc)CPU Affinity.
  72. * CPU_ZERO: (libc)CPU Affinity.
  73. * CPU_ZERO_S: (libc)CPU Affinity.
  74. * CREAD: (libc)Control Modes.
  75. * CRTS_IFLOW: (libc)Control Modes.
  76. * CS5: (libc)Control Modes.
  77. * CS6: (libc)Control Modes.
  78. * CS7: (libc)Control Modes.
  79. * CS8: (libc)Control Modes.
  80. * CSIZE: (libc)Control Modes.
  81. * CSTOPB: (libc)Control Modes.
  82. * DLFO_EH_SEGMENT_TYPE: (libc)Dynamic Linker Introspection.
  83. * DLFO_STRUCT_HAS_EH_COUNT: (libc)Dynamic Linker Introspection.
  84. * DLFO_STRUCT_HAS_EH_DBASE: (libc)Dynamic Linker Introspection.
  85. * DTTOIF: (libc)Directory Entries.
  86. * E2BIG: (libc)Error Codes.
  87. * EACCES: (libc)Error Codes.
  88. * EADDRINUSE: (libc)Error Codes.
  89. * EADDRNOTAVAIL: (libc)Error Codes.
  90. * EADV: (libc)Error Codes.
  91. * EAFNOSUPPORT: (libc)Error Codes.
  92. * EAGAIN: (libc)Error Codes.
  93. * EALREADY: (libc)Error Codes.
  94. * EAUTH: (libc)Error Codes.
  95. * EBACKGROUND: (libc)Error Codes.
  96. * EBADE: (libc)Error Codes.
  97. * EBADF: (libc)Error Codes.
  98. * EBADFD: (libc)Error Codes.
  99. * EBADMSG: (libc)Error Codes.
  100. * EBADR: (libc)Error Codes.
  101. * EBADRPC: (libc)Error Codes.
  102. * EBADRQC: (libc)Error Codes.
  103. * EBADSLT: (libc)Error Codes.
  104. * EBFONT: (libc)Error Codes.
  105. * EBUSY: (libc)Error Codes.
  106. * ECANCELED: (libc)Error Codes.
  107. * ECHILD: (libc)Error Codes.
  108. * ECHO: (libc)Local Modes.
  109. * ECHOCTL: (libc)Local Modes.
  110. * ECHOE: (libc)Local Modes.
  111. * ECHOK: (libc)Local Modes.
  112. * ECHOKE: (libc)Local Modes.
  113. * ECHONL: (libc)Local Modes.
  114. * ECHOPRT: (libc)Local Modes.
  115. * ECHRNG: (libc)Error Codes.
  116. * ECOMM: (libc)Error Codes.
  117. * ECONNABORTED: (libc)Error Codes.
  118. * ECONNREFUSED: (libc)Error Codes.
  119. * ECONNRESET: (libc)Error Codes.
  120. * ED: (libc)Error Codes.
  121. * EDEADLK: (libc)Error Codes.
  122. * EDEADLOCK: (libc)Error Codes.
  123. * EDESTADDRREQ: (libc)Error Codes.
  124. * EDIED: (libc)Error Codes.
  125. * EDOM: (libc)Error Codes.
  126. * EDOTDOT: (libc)Error Codes.
  127. * EDQUOT: (libc)Error Codes.
  128. * EEXIST: (libc)Error Codes.
  129. * EFAULT: (libc)Error Codes.
  130. * EFBIG: (libc)Error Codes.
  131. * EFTYPE: (libc)Error Codes.
  132. * EGRATUITOUS: (libc)Error Codes.
  133. * EGREGIOUS: (libc)Error Codes.
  134. * EHOSTDOWN: (libc)Error Codes.
  135. * EHOSTUNREACH: (libc)Error Codes.
  136. * EHWPOISON: (libc)Error Codes.
  137. * EIDRM: (libc)Error Codes.
  138. * EIEIO: (libc)Error Codes.
  139. * EILSEQ: (libc)Error Codes.
  140. * EINPROGRESS: (libc)Error Codes.
  141. * EINTR: (libc)Error Codes.
  142. * EINVAL: (libc)Error Codes.
  143. * EIO: (libc)Error Codes.
  144. * EISCONN: (libc)Error Codes.
  145. * EISDIR: (libc)Error Codes.
  146. * EISNAM: (libc)Error Codes.
  147. * EKEYEXPIRED: (libc)Error Codes.
  148. * EKEYREJECTED: (libc)Error Codes.
  149. * EKEYREVOKED: (libc)Error Codes.
  150. * EL2HLT: (libc)Error Codes.
  151. * EL2NSYNC: (libc)Error Codes.
  152. * EL3HLT: (libc)Error Codes.
  153. * EL3RST: (libc)Error Codes.
  154. * ELIBACC: (libc)Error Codes.
  155. * ELIBBAD: (libc)Error Codes.
  156. * ELIBEXEC: (libc)Error Codes.
  157. * ELIBMAX: (libc)Error Codes.
  158. * ELIBSCN: (libc)Error Codes.
  159. * ELNRNG: (libc)Error Codes.
  160. * ELOOP: (libc)Error Codes.
  161. * EMEDIUMTYPE: (libc)Error Codes.
  162. * EMFILE: (libc)Error Codes.
  163. * EMLINK: (libc)Error Codes.
  164. * EMSGSIZE: (libc)Error Codes.
  165. * EMULTIHOP: (libc)Error Codes.
  166. * ENAMETOOLONG: (libc)Error Codes.
  167. * ENAVAIL: (libc)Error Codes.
  168. * ENEEDAUTH: (libc)Error Codes.
  169. * ENETDOWN: (libc)Error Codes.
  170. * ENETRESET: (libc)Error Codes.
  171. * ENETUNREACH: (libc)Error Codes.
  172. * ENFILE: (libc)Error Codes.
  173. * ENOANO: (libc)Error Codes.
  174. * ENOBUFS: (libc)Error Codes.
  175. * ENOCSI: (libc)Error Codes.
  176. * ENODATA: (libc)Error Codes.
  177. * ENODEV: (libc)Error Codes.
  178. * ENOENT: (libc)Error Codes.
  179. * ENOEXEC: (libc)Error Codes.
  180. * ENOKEY: (libc)Error Codes.
  181. * ENOLCK: (libc)Error Codes.
  182. * ENOLINK: (libc)Error Codes.
  183. * ENOMEDIUM: (libc)Error Codes.
  184. * ENOMEM: (libc)Error Codes.
  185. * ENOMSG: (libc)Error Codes.
  186. * ENONET: (libc)Error Codes.
  187. * ENOPKG: (libc)Error Codes.
  188. * ENOPROTOOPT: (libc)Error Codes.
  189. * ENOSPC: (libc)Error Codes.
  190. * ENOSR: (libc)Error Codes.
  191. * ENOSTR: (libc)Error Codes.
  192. * ENOSYS: (libc)Error Codes.
  193. * ENOTBLK: (libc)Error Codes.
  194. * ENOTCONN: (libc)Error Codes.
  195. * ENOTDIR: (libc)Error Codes.
  196. * ENOTEMPTY: (libc)Error Codes.
  197. * ENOTNAM: (libc)Error Codes.
  198. * ENOTRECOVERABLE: (libc)Error Codes.
  199. * ENOTSOCK: (libc)Error Codes.
  200. * ENOTSUP: (libc)Error Codes.
  201. * ENOTTY: (libc)Error Codes.
  202. * ENOTUNIQ: (libc)Error Codes.
  203. * ENXIO: (libc)Error Codes.
  204. * EOF: (libc)EOF and Errors.
  205. * EOPNOTSUPP: (libc)Error Codes.
  206. * EOVERFLOW: (libc)Error Codes.
  207. * EOWNERDEAD: (libc)Error Codes.
  208. * EPERM: (libc)Error Codes.
  209. * EPFNOSUPPORT: (libc)Error Codes.
  210. * EPIPE: (libc)Error Codes.
  211. * EPROCLIM: (libc)Error Codes.
  212. * EPROCUNAVAIL: (libc)Error Codes.
  213. * EPROGMISMATCH: (libc)Error Codes.
  214. * EPROGUNAVAIL: (libc)Error Codes.
  215. * EPROTO: (libc)Error Codes.
  216. * EPROTONOSUPPORT: (libc)Error Codes.
  217. * EPROTOTYPE: (libc)Error Codes.
  218. * EQUIV_CLASS_MAX: (libc)Utility Limits.
  219. * ERANGE: (libc)Error Codes.
  220. * EREMCHG: (libc)Error Codes.
  221. * EREMOTE: (libc)Error Codes.
  222. * EREMOTEIO: (libc)Error Codes.
  223. * ERESTART: (libc)Error Codes.
  224. * ERFKILL: (libc)Error Codes.
  225. * EROFS: (libc)Error Codes.
  226. * ERPCMISMATCH: (libc)Error Codes.
  227. * ESHUTDOWN: (libc)Error Codes.
  228. * ESOCKTNOSUPPORT: (libc)Error Codes.
  229. * ESPIPE: (libc)Error Codes.
  230. * ESRCH: (libc)Error Codes.
  231. * ESRMNT: (libc)Error Codes.
  232. * ESTALE: (libc)Error Codes.
  233. * ESTRPIPE: (libc)Error Codes.
  234. * ETIME: (libc)Error Codes.
  235. * ETIMEDOUT: (libc)Error Codes.
  236. * ETOOMANYREFS: (libc)Error Codes.
  237. * ETXTBSY: (libc)Error Codes.
  238. * EUCLEAN: (libc)Error Codes.
  239. * EUNATCH: (libc)Error Codes.
  240. * EUSERS: (libc)Error Codes.
  241. * EWOULDBLOCK: (libc)Error Codes.
  242. * EXDEV: (libc)Error Codes.
  243. * EXFULL: (libc)Error Codes.
  244. * EXIT_FAILURE: (libc)Exit Status.
  245. * EXIT_SUCCESS: (libc)Exit Status.
  246. * EXPR_NEST_MAX: (libc)Utility Limits.
  247. * FD_CLOEXEC: (libc)Descriptor Flags.
  248. * FD_CLR: (libc)Waiting for I/O.
  249. * FD_ISSET: (libc)Waiting for I/O.
  250. * FD_SET: (libc)Waiting for I/O.
  251. * FD_SETSIZE: (libc)Waiting for I/O.
  252. * FD_ZERO: (libc)Waiting for I/O.
  253. * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
  254. * FILENAME_MAX: (libc)Limits for Files.
  255. * FLUSHO: (libc)Local Modes.
  256. * FOPEN_MAX: (libc)Opening Streams.
  257. * FP_ILOGB0: (libc)Exponents and Logarithms.
  258. * FP_ILOGBNAN: (libc)Exponents and Logarithms.
  259. * FP_LLOGB0: (libc)Exponents and Logarithms.
  260. * FP_LLOGBNAN: (libc)Exponents and Logarithms.
  261. * F_DUPFD: (libc)Duplicating Descriptors.
  262. * F_GETFD: (libc)Descriptor Flags.
  263. * F_GETFL: (libc)Getting File Status Flags.
  264. * F_GETLK: (libc)File Locks.
  265. * F_GETOWN: (libc)Interrupt Input.
  266. * F_OFD_GETLK: (libc)Open File Description Locks.
  267. * F_OFD_SETLK: (libc)Open File Description Locks.
  268. * F_OFD_SETLKW: (libc)Open File Description Locks.
  269. * F_OK: (libc)Testing File Access.
  270. * F_SETFD: (libc)Descriptor Flags.
  271. * F_SETFL: (libc)Getting File Status Flags.
  272. * F_SETLK: (libc)File Locks.
  273. * F_SETLKW: (libc)File Locks.
  274. * F_SETOWN: (libc)Interrupt Input.
  275. * HUGE_VAL: (libc)Math Error Reporting.
  276. * HUGE_VALF: (libc)Math Error Reporting.
  277. * HUGE_VALL: (libc)Math Error Reporting.
  278. * HUGE_VAL_FN: (libc)Math Error Reporting.
  279. * HUGE_VAL_FNx: (libc)Math Error Reporting.
  280. * HUPCL: (libc)Control Modes.
  281. * I: (libc)Complex Numbers.
  282. * ICANON: (libc)Local Modes.
  283. * ICRNL: (libc)Input Modes.
  284. * IEXTEN: (libc)Local Modes.
  285. * IFNAMSIZ: (libc)Interface Naming.
  286. * IFTODT: (libc)Directory Entries.
  287. * IGNBRK: (libc)Input Modes.
  288. * IGNCR: (libc)Input Modes.
  289. * IGNPAR: (libc)Input Modes.
  290. * IMAXBEL: (libc)Input Modes.
  291. * INADDR_ANY: (libc)Host Address Data Type.
  292. * INADDR_BROADCAST: (libc)Host Address Data Type.
  293. * INADDR_LOOPBACK: (libc)Host Address Data Type.
  294. * INADDR_NONE: (libc)Host Address Data Type.
  295. * INFINITY: (libc)Infinity and NaN.
  296. * INLCR: (libc)Input Modes.
  297. * INPCK: (libc)Input Modes.
  298. * IPPORT_RESERVED: (libc)Ports.
  299. * IPPORT_USERRESERVED: (libc)Ports.
  300. * ISIG: (libc)Local Modes.
  301. * ISTRIP: (libc)Input Modes.
  302. * IXANY: (libc)Input Modes.
  303. * IXOFF: (libc)Input Modes.
  304. * IXON: (libc)Input Modes.
  305. * LINE_MAX: (libc)Utility Limits.
  306. * LINK_MAX: (libc)Limits for Files.
  307. * L_ctermid: (libc)Identifying the Terminal.
  308. * L_cuserid: (libc)Who Logged In.
  309. * L_tmpnam: (libc)Temporary Files.
  310. * MAXNAMLEN: (libc)Limits for Files.
  311. * MAXSYMLINKS: (libc)Symbolic Links.
  312. * MAX_CANON: (libc)Limits for Files.
  313. * MAX_INPUT: (libc)Limits for Files.
  314. * MB_CUR_MAX: (libc)Selecting the Conversion.
  315. * MB_LEN_MAX: (libc)Selecting the Conversion.
  316. * MDMBUF: (libc)Control Modes.
  317. * MSG_DONTROUTE: (libc)Socket Data Options.
  318. * MSG_OOB: (libc)Socket Data Options.
  319. * MSG_PEEK: (libc)Socket Data Options.
  320. * NAME_MAX: (libc)Limits for Files.
  321. * NAN: (libc)Infinity and NaN.
  322. * NCCS: (libc)Mode Data Types.
  323. * NGROUPS_MAX: (libc)General Limits.
  324. * NOFLSH: (libc)Local Modes.
  325. * NOKERNINFO: (libc)Local Modes.
  326. * NSIG: (libc)Standard Signals.
  327. * NULL: (libc)Null Pointer Constant.
  328. * ONLCR: (libc)Output Modes.
  329. * ONOEOT: (libc)Output Modes.
  330. * OPEN_MAX: (libc)General Limits.
  331. * OPOST: (libc)Output Modes.
  332. * OXTABS: (libc)Output Modes.
  333. * O_ACCMODE: (libc)Access Modes.
  334. * O_APPEND: (libc)Operating Modes.
  335. * O_ASYNC: (libc)Operating Modes.
  336. * O_CREAT: (libc)Open-time Flags.
  337. * O_DIRECTORY: (libc)Open-time Flags.
  338. * O_EXCL: (libc)Open-time Flags.
  339. * O_EXEC: (libc)Access Modes.
  340. * O_EXLOCK: (libc)Open-time Flags.
  341. * O_FSYNC: (libc)Operating Modes.
  342. * O_IGNORE_CTTY: (libc)Open-time Flags.
  343. * O_NDELAY: (libc)Operating Modes.
  344. * O_NOATIME: (libc)Operating Modes.
  345. * O_NOCTTY: (libc)Open-time Flags.
  346. * O_NOFOLLOW: (libc)Open-time Flags.
  347. * O_NOLINK: (libc)Open-time Flags.
  348. * O_NONBLOCK: (libc)Open-time Flags.
  349. * O_NONBLOCK: (libc)Operating Modes.
  350. * O_NOTRANS: (libc)Open-time Flags.
  351. * O_PATH: (libc)Access Modes.
  352. * O_RDONLY: (libc)Access Modes.
  353. * O_RDWR: (libc)Access Modes.
  354. * O_READ: (libc)Access Modes.
  355. * O_SHLOCK: (libc)Open-time Flags.
  356. * O_SYNC: (libc)Operating Modes.
  357. * O_TMPFILE: (libc)Open-time Flags.
  358. * O_TRUNC: (libc)Open-time Flags.
  359. * O_WRITE: (libc)Access Modes.
  360. * O_WRONLY: (libc)Access Modes.
  361. * PARENB: (libc)Control Modes.
  362. * PARMRK: (libc)Input Modes.
  363. * PARODD: (libc)Control Modes.
  364. * PATH_MAX: (libc)Limits for Files.
  365. * PA_FLAG_MASK: (libc)Parsing a Template String.
  366. * PENDIN: (libc)Local Modes.
  367. * PF_FILE: (libc)Local Namespace Details.
  368. * PF_INET6: (libc)Internet Namespace.
  369. * PF_INET: (libc)Internet Namespace.
  370. * PF_LOCAL: (libc)Local Namespace Details.
  371. * PF_UNIX: (libc)Local Namespace Details.
  372. * PIPE_BUF: (libc)Limits for Files.
  373. * PTHREAD_ATTR_NO_SIGMASK_NP: (libc)Initial Thread Signal Mask.
  374. * P_tmpdir: (libc)Temporary Files.
  375. * RAND_MAX: (libc)ISO Random.
  376. * RE_DUP_MAX: (libc)General Limits.
  377. * RLIM_INFINITY: (libc)Limits on Resources.
  378. * RSEQ_SIG: (libc)Restartable Sequences.
  379. * R_OK: (libc)Testing File Access.
  380. * SA_NOCLDSTOP: (libc)Flags for Sigaction.
  381. * SA_NOCLDWAIT: (libc)Flags for Sigaction.
  382. * SA_NODEFER: (libc)Flags for Sigaction.
  383. * SA_ONSTACK: (libc)Flags for Sigaction.
  384. * SA_RESETHAND: (libc)Flags for Sigaction.
  385. * SA_RESTART: (libc)Flags for Sigaction.
  386. * SA_SIGINFO: (libc)Flags for Sigaction.
  387. * SEEK_CUR: (libc)File Positioning.
  388. * SEEK_END: (libc)File Positioning.
  389. * SEEK_SET: (libc)File Positioning.
  390. * SIGABRT: (libc)Program Error Signals.
  391. * SIGALRM: (libc)Alarm Signals.
  392. * SIGBUS: (libc)Program Error Signals.
  393. * SIGCHLD: (libc)Job Control Signals.
  394. * SIGCLD: (libc)Job Control Signals.
  395. * SIGCONT: (libc)Job Control Signals.
  396. * SIGEMT: (libc)Program Error Signals.
  397. * SIGFPE: (libc)Program Error Signals.
  398. * SIGHUP: (libc)Termination Signals.
  399. * SIGILL: (libc)Program Error Signals.
  400. * SIGINFO: (libc)Miscellaneous Signals.
  401. * SIGINT: (libc)Termination Signals.
  402. * SIGIO: (libc)Asynchronous I/O Signals.
  403. * SIGIOT: (libc)Program Error Signals.
  404. * SIGKILL: (libc)Termination Signals.
  405. * SIGLOST: (libc)Operation Error Signals.
  406. * SIGPIPE: (libc)Operation Error Signals.
  407. * SIGPOLL: (libc)Asynchronous I/O Signals.
  408. * SIGPROF: (libc)Alarm Signals.
  409. * SIGPWR: (libc)Miscellaneous Signals.
  410. * SIGQUIT: (libc)Termination Signals.
  411. * SIGSEGV: (libc)Program Error Signals.
  412. * SIGSTKFLT: (libc)Program Error Signals.
  413. * SIGSTOP: (libc)Job Control Signals.
  414. * SIGSYS: (libc)Program Error Signals.
  415. * SIGTERM: (libc)Termination Signals.
  416. * SIGTRAP: (libc)Program Error Signals.
  417. * SIGTSTP: (libc)Job Control Signals.
  418. * SIGTTIN: (libc)Job Control Signals.
  419. * SIGTTOU: (libc)Job Control Signals.
  420. * SIGURG: (libc)Asynchronous I/O Signals.
  421. * SIGUSR1: (libc)Miscellaneous Signals.
  422. * SIGUSR2: (libc)Miscellaneous Signals.
  423. * SIGVTALRM: (libc)Alarm Signals.
  424. * SIGWINCH: (libc)Miscellaneous Signals.
  425. * SIGXCPU: (libc)Operation Error Signals.
  426. * SIGXFSZ: (libc)Operation Error Signals.
  427. * SIG_ERR: (libc)Basic Signal Handling.
  428. * SNAN: (libc)Infinity and NaN.
  429. * SNANF: (libc)Infinity and NaN.
  430. * SNANFN: (libc)Infinity and NaN.
  431. * SNANFNx: (libc)Infinity and NaN.
  432. * SNANL: (libc)Infinity and NaN.
  433. * SOCK_DGRAM: (libc)Communication Styles.
  434. * SOCK_RAW: (libc)Communication Styles.
  435. * SOCK_RDM: (libc)Communication Styles.
  436. * SOCK_SEQPACKET: (libc)Communication Styles.
  437. * SOCK_STREAM: (libc)Communication Styles.
  438. * SOL_SOCKET: (libc)Socket-Level Options.
  439. * SPEED_MAX: (libc)Line Speed.
  440. * SSIZE_MAX: (libc)General Limits.
  441. * STREAM_MAX: (libc)General Limits.
  442. * SUN_LEN: (libc)Local Namespace Details.
  443. * S_IFMT: (libc)Testing File Type.
  444. * S_ISBLK: (libc)Testing File Type.
  445. * S_ISCHR: (libc)Testing File Type.
  446. * S_ISDIR: (libc)Testing File Type.
  447. * S_ISFIFO: (libc)Testing File Type.
  448. * S_ISLNK: (libc)Testing File Type.
  449. * S_ISREG: (libc)Testing File Type.
  450. * S_ISSOCK: (libc)Testing File Type.
  451. * S_TYPEISMQ: (libc)Testing File Type.
  452. * S_TYPEISSEM: (libc)Testing File Type.
  453. * S_TYPEISSHM: (libc)Testing File Type.
  454. * TIME_UTC: (libc)Getting the Time.
  455. * TMP_MAX: (libc)Temporary Files.
  456. * TOSTOP: (libc)Local Modes.
  457. * TZNAME_MAX: (libc)General Limits.
  458. * VDISCARD: (libc)Other Special.
  459. * VDSUSP: (libc)Signal Characters.
  460. * VEOF: (libc)Editing Characters.
  461. * VEOL2: (libc)Editing Characters.
  462. * VEOL: (libc)Editing Characters.
  463. * VERASE: (libc)Editing Characters.
  464. * VINTR: (libc)Signal Characters.
  465. * VKILL: (libc)Editing Characters.
  466. * VLNEXT: (libc)Other Special.
  467. * VMIN: (libc)Noncanonical Input.
  468. * VQUIT: (libc)Signal Characters.
  469. * VREPRINT: (libc)Editing Characters.
  470. * VSTART: (libc)Start/Stop Characters.
  471. * VSTATUS: (libc)Other Special.
  472. * VSTOP: (libc)Start/Stop Characters.
  473. * VSUSP: (libc)Signal Characters.
  474. * VTIME: (libc)Noncanonical Input.
  475. * VWERASE: (libc)Editing Characters.
  476. * WCHAR_MAX: (libc)Extended Char Intro.
  477. * WCHAR_MIN: (libc)Extended Char Intro.
  478. * WCOREDUMP: (libc)Process Completion Status.
  479. * WEOF: (libc)EOF and Errors.
  480. * WEOF: (libc)Extended Char Intro.
  481. * WEXITSTATUS: (libc)Process Completion Status.
  482. * WIFEXITED: (libc)Process Completion Status.
  483. * WIFSIGNALED: (libc)Process Completion Status.
  484. * WIFSTOPPED: (libc)Process Completion Status.
  485. * WSTOPSIG: (libc)Process Completion Status.
  486. * WTERMSIG: (libc)Process Completion Status.
  487. * W_OK: (libc)Testing File Access.
  488. * X_OK: (libc)Testing File Access.
  489. * _Complex_I: (libc)Complex Numbers.
  490. * _Exit: (libc)Termination Internals.
  491. * _Fork: (libc)Creating a Process.
  492. * _IOFBF: (libc)Controlling Buffering.
  493. * _IOLBF: (libc)Controlling Buffering.
  494. * _IONBF: (libc)Controlling Buffering.
  495. * _Imaginary_I: (libc)Complex Numbers.
  496. * _PATH_UTMP: (libc)Manipulating the Database.
  497. * _PATH_WTMP: (libc)Manipulating the Database.
  498. * _POSIX2_C_DEV: (libc)System Options.
  499. * _POSIX2_C_VERSION: (libc)Version Supported.
  500. * _POSIX2_FORT_DEV: (libc)System Options.
  501. * _POSIX2_FORT_RUN: (libc)System Options.
  502. * _POSIX2_LOCALEDEF: (libc)System Options.
  503. * _POSIX2_SW_DEV: (libc)System Options.
  504. * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
  505. * _POSIX_JOB_CONTROL: (libc)System Options.
  506. * _POSIX_NO_TRUNC: (libc)Options for Files.
  507. * _POSIX_SAVED_IDS: (libc)System Options.
  508. * _POSIX_VDISABLE: (libc)Options for Files.
  509. * _POSIX_VERSION: (libc)Version Supported.
  510. * __fbufsize: (libc)Controlling Buffering.
  511. * __flbf: (libc)Controlling Buffering.
  512. * __fpending: (libc)Controlling Buffering.
  513. * __fpurge: (libc)Flushing Buffers.
  514. * __freadable: (libc)Opening Streams.
  515. * __freading: (libc)Opening Streams.
  516. * __fsetlocking: (libc)Streams and Threads.
  517. * __fwritable: (libc)Opening Streams.
  518. * __fwriting: (libc)Opening Streams.
  519. * __gconv_end_fct: (libc)glibc iconv Implementation.
  520. * __gconv_fct: (libc)glibc iconv Implementation.
  521. * __gconv_init_fct: (libc)glibc iconv Implementation.
  522. * __ppc_get_timebase: (libc)PowerPC.
  523. * __ppc_get_timebase_freq: (libc)PowerPC.
  524. * __ppc_mdoio: (libc)PowerPC.
  525. * __ppc_mdoom: (libc)PowerPC.
  526. * __ppc_set_ppr_low: (libc)PowerPC.
  527. * __ppc_set_ppr_med: (libc)PowerPC.
  528. * __ppc_set_ppr_med_high: (libc)PowerPC.
  529. * __ppc_set_ppr_med_low: (libc)PowerPC.
  530. * __ppc_set_ppr_very_low: (libc)PowerPC.
  531. * __ppc_yield: (libc)PowerPC.
  532. * __riscv_flush_icache: (libc)RISC-V.
  533. * __va_copy: (libc)Argument Macros.
  534. * __x86_get_cpuid_feature_leaf: (libc)X86.
  535. * _dl_find_object: (libc)Dynamic Linker Introspection.
  536. * _exit: (libc)Termination Internals.
  537. * _flushlbf: (libc)Flushing Buffers.
  538. * _tolower: (libc)Case Conversion.
  539. * _toupper: (libc)Case Conversion.
  540. * a64l: (libc)Encode Binary Data.
  541. * abort: (libc)Aborting a Program.
  542. * abs: (libc)Absolute Value.
  543. * accept: (libc)Accepting Connections.
  544. * access: (libc)Testing File Access.
  545. * acos: (libc)Inverse Trig Functions.
  546. * acosf: (libc)Inverse Trig Functions.
  547. * acosfN: (libc)Inverse Trig Functions.
  548. * acosfNx: (libc)Inverse Trig Functions.
  549. * acosh: (libc)Hyperbolic Functions.
  550. * acoshf: (libc)Hyperbolic Functions.
  551. * acoshfN: (libc)Hyperbolic Functions.
  552. * acoshfNx: (libc)Hyperbolic Functions.
  553. * acoshl: (libc)Hyperbolic Functions.
  554. * acosl: (libc)Inverse Trig Functions.
  555. * acospi: (libc)Inverse Trig Functions.
  556. * acospif: (libc)Inverse Trig Functions.
  557. * acospifN: (libc)Inverse Trig Functions.
  558. * acospifNx: (libc)Inverse Trig Functions.
  559. * acospil: (libc)Inverse Trig Functions.
  560. * addmntent: (libc)mtab.
  561. * addseverity: (libc)Adding Severity Classes.
  562. * adjtime: (libc)Setting and Adjusting the Time.
  563. * adjtimex: (libc)Setting and Adjusting the Time.
  564. * aio_cancel64: (libc)Cancel AIO Operations.
  565. * aio_cancel: (libc)Cancel AIO Operations.
  566. * aio_error64: (libc)Status of AIO Operations.
  567. * aio_error: (libc)Status of AIO Operations.
  568. * aio_fsync64: (libc)Synchronizing AIO Operations.
  569. * aio_fsync: (libc)Synchronizing AIO Operations.
  570. * aio_init: (libc)Configuration of AIO.
  571. * aio_read64: (libc)Asynchronous Reads/Writes.
  572. * aio_read: (libc)Asynchronous Reads/Writes.
  573. * aio_return64: (libc)Status of AIO Operations.
  574. * aio_return: (libc)Status of AIO Operations.
  575. * aio_suspend64: (libc)Synchronizing AIO Operations.
  576. * aio_suspend: (libc)Synchronizing AIO Operations.
  577. * aio_write64: (libc)Asynchronous Reads/Writes.
  578. * aio_write: (libc)Asynchronous Reads/Writes.
  579. * alarm: (libc)Setting an Alarm.
  580. * aligned_alloc: (libc)Aligned Memory Blocks.
  581. * alloca: (libc)Variable Size Automatic.
  582. * alphasort64: (libc)Scanning Directory Content.
  583. * alphasort: (libc)Scanning Directory Content.
  584. * arc4random: (libc)High Quality Random.
  585. * arc4random_buf: (libc)High Quality Random.
  586. * arc4random_uniform: (libc)High Quality Random.
  587. * argp_error: (libc)Argp Helper Functions.
  588. * argp_failure: (libc)Argp Helper Functions.
  589. * argp_help: (libc)Argp Help.
  590. * argp_parse: (libc)Argp.
  591. * argp_state_help: (libc)Argp Helper Functions.
  592. * argp_usage: (libc)Argp Helper Functions.
  593. * argz_add: (libc)Argz Functions.
  594. * argz_add_sep: (libc)Argz Functions.
  595. * argz_append: (libc)Argz Functions.
  596. * argz_count: (libc)Argz Functions.
  597. * argz_create: (libc)Argz Functions.
  598. * argz_create_sep: (libc)Argz Functions.
  599. * argz_delete: (libc)Argz Functions.
  600. * argz_extract: (libc)Argz Functions.
  601. * argz_insert: (libc)Argz Functions.
  602. * argz_next: (libc)Argz Functions.
  603. * argz_replace: (libc)Argz Functions.
  604. * argz_stringify: (libc)Argz Functions.
  605. * asctime: (libc)Formatting Calendar Time.
  606. * asctime_r: (libc)Formatting Calendar Time.
  607. * asin: (libc)Inverse Trig Functions.
  608. * asinf: (libc)Inverse Trig Functions.
  609. * asinfN: (libc)Inverse Trig Functions.
  610. * asinfNx: (libc)Inverse Trig Functions.
  611. * asinh: (libc)Hyperbolic Functions.
  612. * asinhf: (libc)Hyperbolic Functions.
  613. * asinhfN: (libc)Hyperbolic Functions.
  614. * asinhfNx: (libc)Hyperbolic Functions.
  615. * asinhl: (libc)Hyperbolic Functions.
  616. * asinl: (libc)Inverse Trig Functions.
  617. * asinpi: (libc)Inverse Trig Functions.
  618. * asinpif: (libc)Inverse Trig Functions.
  619. * asinpifN: (libc)Inverse Trig Functions.
  620. * asinpifNx: (libc)Inverse Trig Functions.
  621. * asinpil: (libc)Inverse Trig Functions.
  622. * asprintf: (libc)Dynamic Output.
  623. * assert: (libc)Consistency Checking.
  624. * assert_perror: (libc)Consistency Checking.
  625. * atan2: (libc)Inverse Trig Functions.
  626. * atan2f: (libc)Inverse Trig Functions.
  627. * atan2fN: (libc)Inverse Trig Functions.
  628. * atan2fNx: (libc)Inverse Trig Functions.
  629. * atan2l: (libc)Inverse Trig Functions.
  630. * atan2pi: (libc)Inverse Trig Functions.
  631. * atan2pif: (libc)Inverse Trig Functions.
  632. * atan2pifN: (libc)Inverse Trig Functions.
  633. * atan2pifNx: (libc)Inverse Trig Functions.
  634. * atan2pil: (libc)Inverse Trig Functions.
  635. * atan: (libc)Inverse Trig Functions.
  636. * atanf: (libc)Inverse Trig Functions.
  637. * atanfN: (libc)Inverse Trig Functions.
  638. * atanfNx: (libc)Inverse Trig Functions.
  639. * atanh: (libc)Hyperbolic Functions.
  640. * atanhf: (libc)Hyperbolic Functions.
  641. * atanhfN: (libc)Hyperbolic Functions.
  642. * atanhfNx: (libc)Hyperbolic Functions.
  643. * atanhl: (libc)Hyperbolic Functions.
  644. * atanl: (libc)Inverse Trig Functions.
  645. * atanpi: (libc)Inverse Trig Functions.
  646. * atanpif: (libc)Inverse Trig Functions.
  647. * atanpifN: (libc)Inverse Trig Functions.
  648. * atanpifNx: (libc)Inverse Trig Functions.
  649. * atanpil: (libc)Inverse Trig Functions.
  650. * atexit: (libc)Cleanups on Exit.
  651. * atof: (libc)Parsing of Floats.
  652. * atoi: (libc)Parsing of Integers.
  653. * atol: (libc)Parsing of Integers.
  654. * atoll: (libc)Parsing of Integers.
  655. * backtrace: (libc)Backtraces.
  656. * backtrace_symbols: (libc)Backtraces.
  657. * backtrace_symbols_fd: (libc)Backtraces.
  658. * basename: (libc)Finding Tokens in a String.
  659. * basename: (libc)Finding Tokens in a String.
  660. * bcmp: (libc)String/Array Comparison.
  661. * bcopy: (libc)Copying Strings and Arrays.
  662. * bind: (libc)Setting Address.
  663. * bind_textdomain_codeset: (libc)Charset conversion in gettext.
  664. * bindtextdomain: (libc)Locating gettext catalog.
  665. * brk: (libc)Resizing the Data Segment.
  666. * bsearch: (libc)Array Search Function.
  667. * btowc: (libc)Converting a Character.
  668. * bzero: (libc)Copying Strings and Arrays.
  669. * cabs: (libc)Absolute Value.
  670. * cabsf: (libc)Absolute Value.
  671. * cabsfN: (libc)Absolute Value.
  672. * cabsfNx: (libc)Absolute Value.
  673. * cabsl: (libc)Absolute Value.
  674. * cacos: (libc)Inverse Trig Functions.
  675. * cacosf: (libc)Inverse Trig Functions.
  676. * cacosfN: (libc)Inverse Trig Functions.
  677. * cacosfNx: (libc)Inverse Trig Functions.
  678. * cacosh: (libc)Hyperbolic Functions.
  679. * cacoshf: (libc)Hyperbolic Functions.
  680. * cacoshfN: (libc)Hyperbolic Functions.
  681. * cacoshfNx: (libc)Hyperbolic Functions.
  682. * cacoshl: (libc)Hyperbolic Functions.
  683. * cacosl: (libc)Inverse Trig Functions.
  684. * call_once: (libc)Call Once.
  685. * calloc: (libc)Allocating Cleared Space.
  686. * canonicalize: (libc)FP Bit Twiddling.
  687. * canonicalize_file_name: (libc)Symbolic Links.
  688. * canonicalizef: (libc)FP Bit Twiddling.
  689. * canonicalizefN: (libc)FP Bit Twiddling.
  690. * canonicalizefNx: (libc)FP Bit Twiddling.
  691. * canonicalizel: (libc)FP Bit Twiddling.
  692. * carg: (libc)Operations on Complex.
  693. * cargf: (libc)Operations on Complex.
  694. * cargfN: (libc)Operations on Complex.
  695. * cargfNx: (libc)Operations on Complex.
  696. * cargl: (libc)Operations on Complex.
  697. * casin: (libc)Inverse Trig Functions.
  698. * casinf: (libc)Inverse Trig Functions.
  699. * casinfN: (libc)Inverse Trig Functions.
  700. * casinfNx: (libc)Inverse Trig Functions.
  701. * casinh: (libc)Hyperbolic Functions.
  702. * casinhf: (libc)Hyperbolic Functions.
  703. * casinhfN: (libc)Hyperbolic Functions.
  704. * casinhfNx: (libc)Hyperbolic Functions.
  705. * casinhl: (libc)Hyperbolic Functions.
  706. * casinl: (libc)Inverse Trig Functions.
  707. * catan: (libc)Inverse Trig Functions.
  708. * catanf: (libc)Inverse Trig Functions.
  709. * catanfN: (libc)Inverse Trig Functions.
  710. * catanfNx: (libc)Inverse Trig Functions.
  711. * catanh: (libc)Hyperbolic Functions.
  712. * catanhf: (libc)Hyperbolic Functions.
  713. * catanhfN: (libc)Hyperbolic Functions.
  714. * catanhfNx: (libc)Hyperbolic Functions.
  715. * catanhl: (libc)Hyperbolic Functions.
  716. * catanl: (libc)Inverse Trig Functions.
  717. * catclose: (libc)The catgets Functions.
  718. * catgets: (libc)The catgets Functions.
  719. * catopen: (libc)The catgets Functions.
  720. * cbrt: (libc)Exponents and Logarithms.
  721. * cbrtf: (libc)Exponents and Logarithms.
  722. * cbrtfN: (libc)Exponents and Logarithms.
  723. * cbrtfNx: (libc)Exponents and Logarithms.
  724. * cbrtl: (libc)Exponents and Logarithms.
  725. * ccos: (libc)Trig Functions.
  726. * ccosf: (libc)Trig Functions.
  727. * ccosfN: (libc)Trig Functions.
  728. * ccosfNx: (libc)Trig Functions.
  729. * ccosh: (libc)Hyperbolic Functions.
  730. * ccoshf: (libc)Hyperbolic Functions.
  731. * ccoshfN: (libc)Hyperbolic Functions.
  732. * ccoshfNx: (libc)Hyperbolic Functions.
  733. * ccoshl: (libc)Hyperbolic Functions.
  734. * ccosl: (libc)Trig Functions.
  735. * ceil: (libc)Rounding Functions.
  736. * ceilf: (libc)Rounding Functions.
  737. * ceilfN: (libc)Rounding Functions.
  738. * ceilfNx: (libc)Rounding Functions.
  739. * ceill: (libc)Rounding Functions.
  740. * cexp: (libc)Exponents and Logarithms.
  741. * cexpf: (libc)Exponents and Logarithms.
  742. * cexpfN: (libc)Exponents and Logarithms.
  743. * cexpfNx: (libc)Exponents and Logarithms.
  744. * cexpl: (libc)Exponents and Logarithms.
  745. * cfgetibaud: (libc)Line Speed.
  746. * cfgetispeed: (libc)Line Speed.
  747. * cfgetobaud: (libc)Line Speed.
  748. * cfgetospeed: (libc)Line Speed.
  749. * cfmakeraw: (libc)Noncanonical Input.
  750. * cfsetbaud: (libc)Line Speed.
  751. * cfsetibaud: (libc)Line Speed.
  752. * cfsetispeed: (libc)Line Speed.
  753. * cfsetobaud: (libc)Line Speed.
  754. * cfsetospeed: (libc)Line Speed.
  755. * cfsetspeed: (libc)Line Speed.
  756. * chdir: (libc)Working Directory.
  757. * chmod: (libc)Setting Permissions.
  758. * chown: (libc)File Owner.
  759. * cimag: (libc)Operations on Complex.
  760. * cimagf: (libc)Operations on Complex.
  761. * cimagfN: (libc)Operations on Complex.
  762. * cimagfNx: (libc)Operations on Complex.
  763. * cimagl: (libc)Operations on Complex.
  764. * clearenv: (libc)Environment Access.
  765. * clearerr: (libc)Error Recovery.
  766. * clearerr_unlocked: (libc)Error Recovery.
  767. * clock: (libc)CPU Time.
  768. * clock_getres: (libc)Getting the Time.
  769. * clock_gettime: (libc)Getting the Time.
  770. * clock_nanosleep: (libc)Sleeping.
  771. * clock_settime: (libc)Setting and Adjusting the Time.
  772. * clog10: (libc)Exponents and Logarithms.
  773. * clog10f: (libc)Exponents and Logarithms.
  774. * clog10fN: (libc)Exponents and Logarithms.
  775. * clog10fNx: (libc)Exponents and Logarithms.
  776. * clog10l: (libc)Exponents and Logarithms.
  777. * clog: (libc)Exponents and Logarithms.
  778. * clogf: (libc)Exponents and Logarithms.
  779. * clogfN: (libc)Exponents and Logarithms.
  780. * clogfNx: (libc)Exponents and Logarithms.
  781. * clogl: (libc)Exponents and Logarithms.
  782. * close: (libc)Opening and Closing Files.
  783. * close_range: (libc)Opening and Closing Files.
  784. * closedir: (libc)Reading/Closing Directory.
  785. * closefrom: (libc)Opening and Closing Files.
  786. * closelog: (libc)closelog.
  787. * cnd_broadcast: (libc)ISO C Condition Variables.
  788. * cnd_destroy: (libc)ISO C Condition Variables.
  789. * cnd_init: (libc)ISO C Condition Variables.
  790. * cnd_signal: (libc)ISO C Condition Variables.
  791. * cnd_timedwait: (libc)ISO C Condition Variables.
  792. * cnd_wait: (libc)ISO C Condition Variables.
  793. * compoundn: (libc)Exponents and Logarithms.
  794. * compoundnf: (libc)Exponents and Logarithms.
  795. * compoundnfN: (libc)Exponents and Logarithms.
  796. * compoundnfNx: (libc)Exponents and Logarithms.
  797. * compoundnl: (libc)Exponents and Logarithms.
  798. * confstr: (libc)String Parameters.
  799. * conj: (libc)Operations on Complex.
  800. * conjf: (libc)Operations on Complex.
  801. * conjfN: (libc)Operations on Complex.
  802. * conjfNx: (libc)Operations on Complex.
  803. * conjl: (libc)Operations on Complex.
  804. * connect: (libc)Connecting.
  805. * copy_file_range: (libc)Copying File Data.
  806. * copysign: (libc)FP Bit Twiddling.
  807. * copysignf: (libc)FP Bit Twiddling.
  808. * copysignfN: (libc)FP Bit Twiddling.
  809. * copysignfNx: (libc)FP Bit Twiddling.
  810. * copysignl: (libc)FP Bit Twiddling.
  811. * cos: (libc)Trig Functions.
  812. * cosf: (libc)Trig Functions.
  813. * cosfN: (libc)Trig Functions.
  814. * cosfNx: (libc)Trig Functions.
  815. * cosh: (libc)Hyperbolic Functions.
  816. * coshf: (libc)Hyperbolic Functions.
  817. * coshfN: (libc)Hyperbolic Functions.
  818. * coshfNx: (libc)Hyperbolic Functions.
  819. * coshl: (libc)Hyperbolic Functions.
  820. * cosl: (libc)Trig Functions.
  821. * cospi: (libc)Trig Functions.
  822. * cospif: (libc)Trig Functions.
  823. * cospifN: (libc)Trig Functions.
  824. * cospifNx: (libc)Trig Functions.
  825. * cospil: (libc)Trig Functions.
  826. * cpow: (libc)Exponents and Logarithms.
  827. * cpowf: (libc)Exponents and Logarithms.
  828. * cpowfN: (libc)Exponents and Logarithms.
  829. * cpowfNx: (libc)Exponents and Logarithms.
  830. * cpowl: (libc)Exponents and Logarithms.
  831. * cproj: (libc)Operations on Complex.
  832. * cprojf: (libc)Operations on Complex.
  833. * cprojfN: (libc)Operations on Complex.
  834. * cprojfNx: (libc)Operations on Complex.
  835. * cprojl: (libc)Operations on Complex.
  836. * creal: (libc)Operations on Complex.
  837. * crealf: (libc)Operations on Complex.
  838. * crealfN: (libc)Operations on Complex.
  839. * crealfNx: (libc)Operations on Complex.
  840. * creall: (libc)Operations on Complex.
  841. * creat64: (libc)Opening and Closing Files.
  842. * creat: (libc)Opening and Closing Files.
  843. * csin: (libc)Trig Functions.
  844. * csinf: (libc)Trig Functions.
  845. * csinfN: (libc)Trig Functions.
  846. * csinfNx: (libc)Trig Functions.
  847. * csinh: (libc)Hyperbolic Functions.
  848. * csinhf: (libc)Hyperbolic Functions.
  849. * csinhfN: (libc)Hyperbolic Functions.
  850. * csinhfNx: (libc)Hyperbolic Functions.
  851. * csinhl: (libc)Hyperbolic Functions.
  852. * csinl: (libc)Trig Functions.
  853. * csqrt: (libc)Exponents and Logarithms.
  854. * csqrtf: (libc)Exponents and Logarithms.
  855. * csqrtfN: (libc)Exponents and Logarithms.
  856. * csqrtfNx: (libc)Exponents and Logarithms.
  857. * csqrtl: (libc)Exponents and Logarithms.
  858. * ctan: (libc)Trig Functions.
  859. * ctanf: (libc)Trig Functions.
  860. * ctanfN: (libc)Trig Functions.
  861. * ctanfNx: (libc)Trig Functions.
  862. * ctanh: (libc)Hyperbolic Functions.
  863. * ctanhf: (libc)Hyperbolic Functions.
  864. * ctanhfN: (libc)Hyperbolic Functions.
  865. * ctanhfNx: (libc)Hyperbolic Functions.
  866. * ctanhl: (libc)Hyperbolic Functions.
  867. * ctanl: (libc)Trig Functions.
  868. * ctermid: (libc)Identifying the Terminal.
  869. * ctime: (libc)Formatting Calendar Time.
  870. * ctime_r: (libc)Formatting Calendar Time.
  871. * cuserid: (libc)Who Logged In.
  872. * daddl: (libc)Misc FP Arithmetic.
  873. * dcgettext: (libc)Translation with gettext.
  874. * dcngettext: (libc)Advanced gettext functions.
  875. * ddivl: (libc)Misc FP Arithmetic.
  876. * dfmal: (libc)Misc FP Arithmetic.
  877. * dgettext: (libc)Translation with gettext.
  878. * difftime: (libc)Calculating Elapsed Time.
  879. * dirfd: (libc)Opening a Directory.
  880. * dirname: (libc)Finding Tokens in a String.
  881. * div: (libc)Integer Division.
  882. * dlinfo: (libc)Dynamic Linker Introspection.
  883. * dmull: (libc)Misc FP Arithmetic.
  884. * dngettext: (libc)Advanced gettext functions.
  885. * dprintf: (libc)Formatted Output Functions.
  886. * drand48: (libc)SVID Random.
  887. * drand48_r: (libc)SVID Random.
  888. * drem: (libc)Remainder Functions.
  889. * dremf: (libc)Remainder Functions.
  890. * dreml: (libc)Remainder Functions.
  891. * dsqrtl: (libc)Misc FP Arithmetic.
  892. * dsubl: (libc)Misc FP Arithmetic.
  893. * dup2: (libc)Duplicating Descriptors.
  894. * dup3: (libc)Duplicating Descriptors.
  895. * dup: (libc)Duplicating Descriptors.
  896. * ecvt: (libc)System V Number Conversion.
  897. * ecvt_r: (libc)System V Number Conversion.
  898. * endfsent: (libc)fstab.
  899. * endgrent: (libc)Scanning All Groups.
  900. * endhostent: (libc)Host Names.
  901. * endmntent: (libc)mtab.
  902. * endnetent: (libc)Networks Database.
  903. * endnetgrent: (libc)Lookup Netgroup.
  904. * endprotoent: (libc)Protocols Database.
  905. * endpwent: (libc)Scanning All Users.
  906. * endservent: (libc)Services Database.
  907. * endutent: (libc)Manipulating the Database.
  908. * endutxent: (libc)XPG Functions.
  909. * envz_add: (libc)Envz Functions.
  910. * envz_entry: (libc)Envz Functions.
  911. * envz_get: (libc)Envz Functions.
  912. * envz_merge: (libc)Envz Functions.
  913. * envz_remove: (libc)Envz Functions.
  914. * envz_strip: (libc)Envz Functions.
  915. * epoll_create: (libc)Other Low-Level I/O APIs.
  916. * epoll_wait: (libc)Other Low-Level I/O APIs.
  917. * erand48: (libc)SVID Random.
  918. * erand48_r: (libc)SVID Random.
  919. * erf: (libc)Special Functions.
  920. * erfc: (libc)Special Functions.
  921. * erfcf: (libc)Special Functions.
  922. * erfcfN: (libc)Special Functions.
  923. * erfcfNx: (libc)Special Functions.
  924. * erfcl: (libc)Special Functions.
  925. * erff: (libc)Special Functions.
  926. * erffN: (libc)Special Functions.
  927. * erffNx: (libc)Special Functions.
  928. * erfl: (libc)Special Functions.
  929. * err: (libc)Error Messages.
  930. * errno: (libc)Checking for Errors.
  931. * error: (libc)Error Messages.
  932. * error_at_line: (libc)Error Messages.
  933. * errx: (libc)Error Messages.
  934. * execl: (libc)Executing a File.
  935. * execle: (libc)Executing a File.
  936. * execlp: (libc)Executing a File.
  937. * execv: (libc)Executing a File.
  938. * execve: (libc)Executing a File.
  939. * execvp: (libc)Executing a File.
  940. * exit: (libc)Normal Termination.
  941. * exp10: (libc)Exponents and Logarithms.
  942. * exp10f: (libc)Exponents and Logarithms.
  943. * exp10fN: (libc)Exponents and Logarithms.
  944. * exp10fNx: (libc)Exponents and Logarithms.
  945. * exp10l: (libc)Exponents and Logarithms.
  946. * exp10m1: (libc)Exponents and Logarithms.
  947. * exp10m1f: (libc)Exponents and Logarithms.
  948. * exp10m1fN: (libc)Exponents and Logarithms.
  949. * exp10m1fNx: (libc)Exponents and Logarithms.
  950. * exp10m1l: (libc)Exponents and Logarithms.
  951. * exp2: (libc)Exponents and Logarithms.
  952. * exp2f: (libc)Exponents and Logarithms.
  953. * exp2fN: (libc)Exponents and Logarithms.
  954. * exp2fNx: (libc)Exponents and Logarithms.
  955. * exp2l: (libc)Exponents and Logarithms.
  956. * exp2m1: (libc)Exponents and Logarithms.
  957. * exp2m1f: (libc)Exponents and Logarithms.
  958. * exp2m1fN: (libc)Exponents and Logarithms.
  959. * exp2m1fNx: (libc)Exponents and Logarithms.
  960. * exp2m1l: (libc)Exponents and Logarithms.
  961. * exp: (libc)Exponents and Logarithms.
  962. * expf: (libc)Exponents and Logarithms.
  963. * expfN: (libc)Exponents and Logarithms.
  964. * expfNx: (libc)Exponents and Logarithms.
  965. * expl: (libc)Exponents and Logarithms.
  966. * explicit_bzero: (libc)Erasing Sensitive Data.
  967. * expm1: (libc)Exponents and Logarithms.
  968. * expm1f: (libc)Exponents and Logarithms.
  969. * expm1fN: (libc)Exponents and Logarithms.
  970. * expm1fNx: (libc)Exponents and Logarithms.
  971. * expm1l: (libc)Exponents and Logarithms.
  972. * fMaddfN: (libc)Misc FP Arithmetic.
  973. * fMaddfNx: (libc)Misc FP Arithmetic.
  974. * fMdivfN: (libc)Misc FP Arithmetic.
  975. * fMdivfNx: (libc)Misc FP Arithmetic.
  976. * fMfmafN: (libc)Misc FP Arithmetic.
  977. * fMfmafNx: (libc)Misc FP Arithmetic.
  978. * fMmulfN: (libc)Misc FP Arithmetic.
  979. * fMmulfNx: (libc)Misc FP Arithmetic.
  980. * fMsqrtfN: (libc)Misc FP Arithmetic.
  981. * fMsqrtfNx: (libc)Misc FP Arithmetic.
  982. * fMsubfN: (libc)Misc FP Arithmetic.
  983. * fMsubfNx: (libc)Misc FP Arithmetic.
  984. * fMxaddfN: (libc)Misc FP Arithmetic.
  985. * fMxaddfNx: (libc)Misc FP Arithmetic.
  986. * fMxdivfN: (libc)Misc FP Arithmetic.
  987. * fMxdivfNx: (libc)Misc FP Arithmetic.
  988. * fMxfmafN: (libc)Misc FP Arithmetic.
  989. * fMxfmafNx: (libc)Misc FP Arithmetic.
  990. * fMxmulfN: (libc)Misc FP Arithmetic.
  991. * fMxmulfNx: (libc)Misc FP Arithmetic.
  992. * fMxsqrtfN: (libc)Misc FP Arithmetic.
  993. * fMxsqrtfNx: (libc)Misc FP Arithmetic.
  994. * fMxsubfN: (libc)Misc FP Arithmetic.
  995. * fMxsubfNx: (libc)Misc FP Arithmetic.
  996. * fabs: (libc)Absolute Value.
  997. * fabsf: (libc)Absolute Value.
  998. * fabsfN: (libc)Absolute Value.
  999. * fabsfNx: (libc)Absolute Value.
  1000. * fabsl: (libc)Absolute Value.
  1001. * faccessat: (libc)Testing File Access.
  1002. * fadd: (libc)Misc FP Arithmetic.
  1003. * faddl: (libc)Misc FP Arithmetic.
  1004. * fchdir: (libc)Working Directory.
  1005. * fchmod: (libc)Setting Permissions.
  1006. * fchown: (libc)File Owner.
  1007. * fclose: (libc)Closing Streams.
  1008. * fcloseall: (libc)Closing Streams.
  1009. * fcntl: (libc)Control Operations.
  1010. * fcvt: (libc)System V Number Conversion.
  1011. * fcvt_r: (libc)System V Number Conversion.
  1012. * fdatasync: (libc)Synchronizing I/O.
  1013. * fdim: (libc)Misc FP Arithmetic.
  1014. * fdimf: (libc)Misc FP Arithmetic.
  1015. * fdimfN: (libc)Misc FP Arithmetic.
  1016. * fdimfNx: (libc)Misc FP Arithmetic.
  1017. * fdiml: (libc)Misc FP Arithmetic.
  1018. * fdiv: (libc)Misc FP Arithmetic.
  1019. * fdivl: (libc)Misc FP Arithmetic.
  1020. * fdopen: (libc)Descriptors and Streams.
  1021. * fdopendir: (libc)Opening a Directory.
  1022. * feclearexcept: (libc)Status bit operations.
  1023. * fedisableexcept: (libc)Control Functions.
  1024. * feenableexcept: (libc)Control Functions.
  1025. * fegetenv: (libc)Control Functions.
  1026. * fegetexcept: (libc)Control Functions.
  1027. * fegetexceptflag: (libc)Status bit operations.
  1028. * fegetmode: (libc)Control Functions.
  1029. * fegetround: (libc)Rounding.
  1030. * feholdexcept: (libc)Control Functions.
  1031. * feof: (libc)EOF and Errors.
  1032. * feof_unlocked: (libc)EOF and Errors.
  1033. * feraiseexcept: (libc)Status bit operations.
  1034. * ferror: (libc)EOF and Errors.
  1035. * ferror_unlocked: (libc)EOF and Errors.
  1036. * fesetenv: (libc)Control Functions.
  1037. * fesetexcept: (libc)Status bit operations.
  1038. * fesetexceptflag: (libc)Status bit operations.
  1039. * fesetmode: (libc)Control Functions.
  1040. * fesetround: (libc)Rounding.
  1041. * fetestexcept: (libc)Status bit operations.
  1042. * fetestexceptflag: (libc)Status bit operations.
  1043. * feupdateenv: (libc)Control Functions.
  1044. * fexecve: (libc)Executing a File.
  1045. * fflush: (libc)Flushing Buffers.
  1046. * fflush_unlocked: (libc)Flushing Buffers.
  1047. * ffma: (libc)Misc FP Arithmetic.
  1048. * ffmal: (libc)Misc FP Arithmetic.
  1049. * fgetc: (libc)Character Input.
  1050. * fgetc_unlocked: (libc)Character Input.
  1051. * fgetgrent: (libc)Scanning All Groups.
  1052. * fgetgrent_r: (libc)Scanning All Groups.
  1053. * fgetpos64: (libc)Portable Positioning.
  1054. * fgetpos: (libc)Portable Positioning.
  1055. * fgetpwent: (libc)Scanning All Users.
  1056. * fgetpwent_r: (libc)Scanning All Users.
  1057. * fgets: (libc)Line Input.
  1058. * fgets_unlocked: (libc)Line Input.
  1059. * fgetwc: (libc)Character Input.
  1060. * fgetwc_unlocked: (libc)Character Input.
  1061. * fgetws: (libc)Line Input.
  1062. * fgetws_unlocked: (libc)Line Input.
  1063. * fileno: (libc)Descriptors and Streams.
  1064. * fileno_unlocked: (libc)Descriptors and Streams.
  1065. * finite: (libc)Floating Point Classes.
  1066. * finitef: (libc)Floating Point Classes.
  1067. * finitel: (libc)Floating Point Classes.
  1068. * flockfile: (libc)Streams and Threads.
  1069. * floor: (libc)Rounding Functions.
  1070. * floorf: (libc)Rounding Functions.
  1071. * floorfN: (libc)Rounding Functions.
  1072. * floorfNx: (libc)Rounding Functions.
  1073. * floorl: (libc)Rounding Functions.
  1074. * fma: (libc)Misc FP Arithmetic.
  1075. * fmaf: (libc)Misc FP Arithmetic.
  1076. * fmafN: (libc)Misc FP Arithmetic.
  1077. * fmafNx: (libc)Misc FP Arithmetic.
  1078. * fmal: (libc)Misc FP Arithmetic.
  1079. * fmax: (libc)Misc FP Arithmetic.
  1080. * fmaxf: (libc)Misc FP Arithmetic.
  1081. * fmaxfN: (libc)Misc FP Arithmetic.
  1082. * fmaxfNx: (libc)Misc FP Arithmetic.
  1083. * fmaximum: (libc)Misc FP Arithmetic.
  1084. * fmaximum_mag: (libc)Misc FP Arithmetic.
  1085. * fmaximum_mag_num: (libc)Misc FP Arithmetic.
  1086. * fmaximum_mag_numf: (libc)Misc FP Arithmetic.
  1087. * fmaximum_mag_numfN: (libc)Misc FP Arithmetic.
  1088. * fmaximum_mag_numfNx: (libc)Misc FP Arithmetic.
  1089. * fmaximum_mag_numl: (libc)Misc FP Arithmetic.
  1090. * fmaximum_magf: (libc)Misc FP Arithmetic.
  1091. * fmaximum_magfN: (libc)Misc FP Arithmetic.
  1092. * fmaximum_magfNx: (libc)Misc FP Arithmetic.
  1093. * fmaximum_magl: (libc)Misc FP Arithmetic.
  1094. * fmaximum_num: (libc)Misc FP Arithmetic.
  1095. * fmaximum_numf: (libc)Misc FP Arithmetic.
  1096. * fmaximum_numfN: (libc)Misc FP Arithmetic.
  1097. * fmaximum_numfNx: (libc)Misc FP Arithmetic.
  1098. * fmaximum_numl: (libc)Misc FP Arithmetic.
  1099. * fmaximumf: (libc)Misc FP Arithmetic.
  1100. * fmaximumfN: (libc)Misc FP Arithmetic.
  1101. * fmaximumfNx: (libc)Misc FP Arithmetic.
  1102. * fmaximuml: (libc)Misc FP Arithmetic.
  1103. * fmaxl: (libc)Misc FP Arithmetic.
  1104. * fmaxmag: (libc)Misc FP Arithmetic.
  1105. * fmaxmagf: (libc)Misc FP Arithmetic.
  1106. * fmaxmagfN: (libc)Misc FP Arithmetic.
  1107. * fmaxmagfNx: (libc)Misc FP Arithmetic.
  1108. * fmaxmagl: (libc)Misc FP Arithmetic.
  1109. * fmemopen: (libc)String Streams.
  1110. * fmin: (libc)Misc FP Arithmetic.
  1111. * fminf: (libc)Misc FP Arithmetic.
  1112. * fminfN: (libc)Misc FP Arithmetic.
  1113. * fminfNx: (libc)Misc FP Arithmetic.
  1114. * fminimum: (libc)Misc FP Arithmetic.
  1115. * fminimum_mag: (libc)Misc FP Arithmetic.
  1116. * fminimum_mag_num: (libc)Misc FP Arithmetic.
  1117. * fminimum_mag_numf: (libc)Misc FP Arithmetic.
  1118. * fminimum_mag_numfN: (libc)Misc FP Arithmetic.
  1119. * fminimum_mag_numfNx: (libc)Misc FP Arithmetic.
  1120. * fminimum_mag_numl: (libc)Misc FP Arithmetic.
  1121. * fminimum_magf: (libc)Misc FP Arithmetic.
  1122. * fminimum_magfN: (libc)Misc FP Arithmetic.
  1123. * fminimum_magfNx: (libc)Misc FP Arithmetic.
  1124. * fminimum_magl: (libc)Misc FP Arithmetic.
  1125. * fminimum_num: (libc)Misc FP Arithmetic.
  1126. * fminimum_numf: (libc)Misc FP Arithmetic.
  1127. * fminimum_numfN: (libc)Misc FP Arithmetic.
  1128. * fminimum_numfNx: (libc)Misc FP Arithmetic.
  1129. * fminimum_numl: (libc)Misc FP Arithmetic.
  1130. * fminimumf: (libc)Misc FP Arithmetic.
  1131. * fminimumfN: (libc)Misc FP Arithmetic.
  1132. * fminimumfNx: (libc)Misc FP Arithmetic.
  1133. * fminimuml: (libc)Misc FP Arithmetic.
  1134. * fminl: (libc)Misc FP Arithmetic.
  1135. * fminmag: (libc)Misc FP Arithmetic.
  1136. * fminmagf: (libc)Misc FP Arithmetic.
  1137. * fminmagfN: (libc)Misc FP Arithmetic.
  1138. * fminmagfNx: (libc)Misc FP Arithmetic.
  1139. * fminmagl: (libc)Misc FP Arithmetic.
  1140. * fmod: (libc)Remainder Functions.
  1141. * fmodf: (libc)Remainder Functions.
  1142. * fmodfN: (libc)Remainder Functions.
  1143. * fmodfNx: (libc)Remainder Functions.
  1144. * fmodl: (libc)Remainder Functions.
  1145. * fmtmsg: (libc)Printing Formatted Messages.
  1146. * fmul: (libc)Misc FP Arithmetic.
  1147. * fmull: (libc)Misc FP Arithmetic.
  1148. * fnmatch: (libc)Wildcard Matching.
  1149. * fopen64: (libc)Opening Streams.
  1150. * fopen: (libc)Opening Streams.
  1151. * fopencookie: (libc)Streams and Cookies.
  1152. * fork: (libc)Creating a Process.
  1153. * forkpty: (libc)Pseudo-Terminal Pairs.
  1154. * fpathconf: (libc)Pathconf.
  1155. * fpclassify: (libc)Floating Point Classes.
  1156. * fprintf: (libc)Formatted Output Functions.
  1157. * fputc: (libc)Simple Output.
  1158. * fputc_unlocked: (libc)Simple Output.
  1159. * fputs: (libc)Simple Output.
  1160. * fputs_unlocked: (libc)Simple Output.
  1161. * fputwc: (libc)Simple Output.
  1162. * fputwc_unlocked: (libc)Simple Output.
  1163. * fputws: (libc)Simple Output.
  1164. * fputws_unlocked: (libc)Simple Output.
  1165. * fread: (libc)Block Input/Output.
  1166. * fread_unlocked: (libc)Block Input/Output.
  1167. * free: (libc)Freeing after Malloc.
  1168. * free_aligned_sized: (libc)Freeing after Malloc.
  1169. * free_sized: (libc)Freeing after Malloc.
  1170. * freopen64: (libc)Opening Streams.
  1171. * freopen: (libc)Opening Streams.
  1172. * frexp: (libc)Normalization Functions.
  1173. * frexpf: (libc)Normalization Functions.
  1174. * frexpfN: (libc)Normalization Functions.
  1175. * frexpfNx: (libc)Normalization Functions.
  1176. * frexpl: (libc)Normalization Functions.
  1177. * fromfp: (libc)Rounding Functions.
  1178. * fromfpf: (libc)Rounding Functions.
  1179. * fromfpfN: (libc)Rounding Functions.
  1180. * fromfpfNx: (libc)Rounding Functions.
  1181. * fromfpl: (libc)Rounding Functions.
  1182. * fromfpx: (libc)Rounding Functions.
  1183. * fromfpxf: (libc)Rounding Functions.
  1184. * fromfpxfN: (libc)Rounding Functions.
  1185. * fromfpxfNx: (libc)Rounding Functions.
  1186. * fromfpxl: (libc)Rounding Functions.
  1187. * fscanf: (libc)Formatted Input Functions.
  1188. * fseek: (libc)File Positioning.
  1189. * fseeko64: (libc)File Positioning.
  1190. * fseeko: (libc)File Positioning.
  1191. * fsetpos64: (libc)Portable Positioning.
  1192. * fsetpos: (libc)Portable Positioning.
  1193. * fsqrt: (libc)Misc FP Arithmetic.
  1194. * fsqrtl: (libc)Misc FP Arithmetic.
  1195. * fstat64: (libc)Reading Attributes.
  1196. * fstat: (libc)Reading Attributes.
  1197. * fstatat64: (libc)Reading Attributes.
  1198. * fstatat: (libc)Reading Attributes.
  1199. * fsub: (libc)Misc FP Arithmetic.
  1200. * fsubl: (libc)Misc FP Arithmetic.
  1201. * fsync: (libc)Synchronizing I/O.
  1202. * ftell: (libc)File Positioning.
  1203. * ftello64: (libc)File Positioning.
  1204. * ftello: (libc)File Positioning.
  1205. * ftruncate64: (libc)File Size.
  1206. * ftruncate: (libc)File Size.
  1207. * ftrylockfile: (libc)Streams and Threads.
  1208. * ftw64: (libc)Working with Directory Trees.
  1209. * ftw: (libc)Working with Directory Trees.
  1210. * funlockfile: (libc)Streams and Threads.
  1211. * futimens: (libc)File Times.
  1212. * futimes: (libc)File Times.
  1213. * fwide: (libc)Streams and I18N.
  1214. * fwprintf: (libc)Formatted Output Functions.
  1215. * fwrite: (libc)Block Input/Output.
  1216. * fwrite_unlocked: (libc)Block Input/Output.
  1217. * fwscanf: (libc)Formatted Input Functions.
  1218. * gamma: (libc)Special Functions.
  1219. * gammaf: (libc)Special Functions.
  1220. * gammal: (libc)Special Functions.
  1221. * gcvt: (libc)System V Number Conversion.
  1222. * get_avphys_pages: (libc)Query Memory Parameters.
  1223. * get_current_dir_name: (libc)Working Directory.
  1224. * get_nprocs: (libc)Processor Resources.
  1225. * get_nprocs_conf: (libc)Processor Resources.
  1226. * get_phys_pages: (libc)Query Memory Parameters.
  1227. * getauxval: (libc)Auxiliary Vector.
  1228. * getc: (libc)Character Input.
  1229. * getc_unlocked: (libc)Character Input.
  1230. * getchar: (libc)Character Input.
  1231. * getchar_unlocked: (libc)Character Input.
  1232. * getcontext: (libc)System V contexts.
  1233. * getcpu: (libc)CPU Affinity.
  1234. * getcwd: (libc)Working Directory.
  1235. * getdate: (libc)General Time String Parsing.
  1236. * getdate_r: (libc)General Time String Parsing.
  1237. * getdelim: (libc)Line Input.
  1238. * getdents64: (libc)Low-level Directory Access.
  1239. * getdomainname: (libc)Host Identification.
  1240. * getegid: (libc)Reading Persona.
  1241. * getentropy: (libc)Unpredictable Bytes.
  1242. * getenv: (libc)Environment Access.
  1243. * geteuid: (libc)Reading Persona.
  1244. * getfsent: (libc)fstab.
  1245. * getfsfile: (libc)fstab.
  1246. * getfsspec: (libc)fstab.
  1247. * getgid: (libc)Reading Persona.
  1248. * getgrent: (libc)Scanning All Groups.
  1249. * getgrent_r: (libc)Scanning All Groups.
  1250. * getgrgid: (libc)Lookup Group.
  1251. * getgrgid_r: (libc)Lookup Group.
  1252. * getgrnam: (libc)Lookup Group.
  1253. * getgrnam_r: (libc)Lookup Group.
  1254. * getgrouplist: (libc)Setting Groups.
  1255. * getgroups: (libc)Reading Persona.
  1256. * gethostbyaddr: (libc)Host Names.
  1257. * gethostbyaddr_r: (libc)Host Names.
  1258. * gethostbyname2: (libc)Host Names.
  1259. * gethostbyname2_r: (libc)Host Names.
  1260. * gethostbyname: (libc)Host Names.
  1261. * gethostbyname_r: (libc)Host Names.
  1262. * gethostent: (libc)Host Names.
  1263. * gethostid: (libc)Host Identification.
  1264. * gethostname: (libc)Host Identification.
  1265. * getitimer: (libc)Setting an Alarm.
  1266. * getline: (libc)Line Input.
  1267. * getloadavg: (libc)Processor Resources.
  1268. * getlogin: (libc)Who Logged In.
  1269. * getmntent: (libc)mtab.
  1270. * getmntent_r: (libc)mtab.
  1271. * getnetbyaddr: (libc)Networks Database.
  1272. * getnetbyname: (libc)Networks Database.
  1273. * getnetent: (libc)Networks Database.
  1274. * getnetgrent: (libc)Lookup Netgroup.
  1275. * getnetgrent_r: (libc)Lookup Netgroup.
  1276. * getopt: (libc)Using Getopt.
  1277. * getopt_long: (libc)Getopt Long Options.
  1278. * getopt_long_only: (libc)Getopt Long Options.
  1279. * getpagesize: (libc)Query Memory Parameters.
  1280. * getpass: (libc)getpass.
  1281. * getpayload: (libc)FP Bit Twiddling.
  1282. * getpayloadf: (libc)FP Bit Twiddling.
  1283. * getpayloadfN: (libc)FP Bit Twiddling.
  1284. * getpayloadfNx: (libc)FP Bit Twiddling.
  1285. * getpayloadl: (libc)FP Bit Twiddling.
  1286. * getpeername: (libc)Who is Connected.
  1287. * getpgid: (libc)Process Group Functions.
  1288. * getpgrp: (libc)Process Group Functions.
  1289. * getpid: (libc)Process Identification.
  1290. * getppid: (libc)Process Identification.
  1291. * getpriority: (libc)Traditional Scheduling Functions.
  1292. * getprotobyname: (libc)Protocols Database.
  1293. * getprotobynumber: (libc)Protocols Database.
  1294. * getprotoent: (libc)Protocols Database.
  1295. * getpt: (libc)Allocation.
  1296. * getpwent: (libc)Scanning All Users.
  1297. * getpwent_r: (libc)Scanning All Users.
  1298. * getpwnam: (libc)Lookup User.
  1299. * getpwnam_r: (libc)Lookup User.
  1300. * getpwuid: (libc)Lookup User.
  1301. * getpwuid_r: (libc)Lookup User.
  1302. * getrandom: (libc)Unpredictable Bytes.
  1303. * getrlimit64: (libc)Limits on Resources.
  1304. * getrlimit: (libc)Limits on Resources.
  1305. * getrusage: (libc)Resource Usage.
  1306. * gets: (libc)Line Input.
  1307. * getservbyname: (libc)Services Database.
  1308. * getservbyport: (libc)Services Database.
  1309. * getservent: (libc)Services Database.
  1310. * getsid: (libc)Process Group Functions.
  1311. * getsockname: (libc)Reading Address.
  1312. * getsockopt: (libc)Socket Option Functions.
  1313. * getsubopt: (libc)Suboptions.
  1314. * gettext: (libc)Translation with gettext.
  1315. * gettid: (libc)Process Identification.
  1316. * gettimeofday: (libc)Getting the Time.
  1317. * getuid: (libc)Reading Persona.
  1318. * getumask: (libc)Setting Permissions.
  1319. * getutent: (libc)Manipulating the Database.
  1320. * getutent_r: (libc)Manipulating the Database.
  1321. * getutid: (libc)Manipulating the Database.
  1322. * getutid_r: (libc)Manipulating the Database.
  1323. * getutline: (libc)Manipulating the Database.
  1324. * getutline_r: (libc)Manipulating the Database.
  1325. * getutmp: (libc)XPG Functions.
  1326. * getutmpx: (libc)XPG Functions.
  1327. * getutxent: (libc)XPG Functions.
  1328. * getutxid: (libc)XPG Functions.
  1329. * getutxline: (libc)XPG Functions.
  1330. * getw: (libc)Character Input.
  1331. * getwc: (libc)Character Input.
  1332. * getwc_unlocked: (libc)Character Input.
  1333. * getwchar: (libc)Character Input.
  1334. * getwchar_unlocked: (libc)Character Input.
  1335. * getwd: (libc)Working Directory.
  1336. * glob64: (libc)Calling Glob.
  1337. * glob: (libc)Calling Glob.
  1338. * globfree64: (libc)More Flags for Globbing.
  1339. * globfree: (libc)More Flags for Globbing.
  1340. * gmtime: (libc)Broken-down Time.
  1341. * gmtime_r: (libc)Broken-down Time.
  1342. * grantpt: (libc)Allocation.
  1343. * gsignal: (libc)Signaling Yourself.
  1344. * gtty: (libc)BSD Terminal Modes.
  1345. * hasmntopt: (libc)mtab.
  1346. * hcreate: (libc)Hash Search Function.
  1347. * hcreate_r: (libc)Hash Search Function.
  1348. * hdestroy: (libc)Hash Search Function.
  1349. * hdestroy_r: (libc)Hash Search Function.
  1350. * hsearch: (libc)Hash Search Function.
  1351. * hsearch_r: (libc)Hash Search Function.
  1352. * htonl: (libc)Byte Order.
  1353. * htons: (libc)Byte Order.
  1354. * hypot: (libc)Exponents and Logarithms.
  1355. * hypotf: (libc)Exponents and Logarithms.
  1356. * hypotfN: (libc)Exponents and Logarithms.
  1357. * hypotfNx: (libc)Exponents and Logarithms.
  1358. * hypotl: (libc)Exponents and Logarithms.
  1359. * iconv: (libc)Generic Conversion Interface.
  1360. * iconv_close: (libc)Generic Conversion Interface.
  1361. * iconv_open: (libc)Generic Conversion Interface.
  1362. * if_freenameindex: (libc)Interface Naming.
  1363. * if_indextoname: (libc)Interface Naming.
  1364. * if_nameindex: (libc)Interface Naming.
  1365. * if_nametoindex: (libc)Interface Naming.
  1366. * ilogb: (libc)Exponents and Logarithms.
  1367. * ilogbf: (libc)Exponents and Logarithms.
  1368. * ilogbfN: (libc)Exponents and Logarithms.
  1369. * ilogbfNx: (libc)Exponents and Logarithms.
  1370. * ilogbl: (libc)Exponents and Logarithms.
  1371. * imaxabs: (libc)Absolute Value.
  1372. * imaxdiv: (libc)Integer Division.
  1373. * in6addr_any: (libc)Host Address Data Type.
  1374. * in6addr_loopback: (libc)Host Address Data Type.
  1375. * index: (libc)Search Functions.
  1376. * inet_addr: (libc)Host Address Functions.
  1377. * inet_aton: (libc)Host Address Functions.
  1378. * inet_lnaof: (libc)Host Address Functions.
  1379. * inet_makeaddr: (libc)Host Address Functions.
  1380. * inet_netof: (libc)Host Address Functions.
  1381. * inet_network: (libc)Host Address Functions.
  1382. * inet_ntoa: (libc)Host Address Functions.
  1383. * inet_ntop: (libc)Host Address Functions.
  1384. * inet_pton: (libc)Host Address Functions.
  1385. * initgroups: (libc)Setting Groups.
  1386. * initstate: (libc)BSD Random.
  1387. * initstate_r: (libc)BSD Random.
  1388. * innetgr: (libc)Netgroup Membership.
  1389. * ioctl: (libc)IOCTLs.
  1390. * isalnum: (libc)Classification of Characters.
  1391. * isalpha: (libc)Classification of Characters.
  1392. * isascii: (libc)Classification of Characters.
  1393. * isatty: (libc)Is It a Terminal.
  1394. * isblank: (libc)Classification of Characters.
  1395. * iscanonical: (libc)Floating Point Classes.
  1396. * iscntrl: (libc)Classification of Characters.
  1397. * isdigit: (libc)Classification of Characters.
  1398. * iseqsig: (libc)FP Comparison Functions.
  1399. * isfinite: (libc)Floating Point Classes.
  1400. * isgraph: (libc)Classification of Characters.
  1401. * isgreater: (libc)FP Comparison Functions.
  1402. * isgreaterequal: (libc)FP Comparison Functions.
  1403. * isinf: (libc)Floating Point Classes.
  1404. * isinff: (libc)Floating Point Classes.
  1405. * isinfl: (libc)Floating Point Classes.
  1406. * isless: (libc)FP Comparison Functions.
  1407. * islessequal: (libc)FP Comparison Functions.
  1408. * islessgreater: (libc)FP Comparison Functions.
  1409. * islower: (libc)Classification of Characters.
  1410. * isnan: (libc)Floating Point Classes.
  1411. * isnan: (libc)Floating Point Classes.
  1412. * isnanf: (libc)Floating Point Classes.
  1413. * isnanl: (libc)Floating Point Classes.
  1414. * isnormal: (libc)Floating Point Classes.
  1415. * isprint: (libc)Classification of Characters.
  1416. * ispunct: (libc)Classification of Characters.
  1417. * issignaling: (libc)Floating Point Classes.
  1418. * isspace: (libc)Classification of Characters.
  1419. * issubnormal: (libc)Floating Point Classes.
  1420. * isunordered: (libc)FP Comparison Functions.
  1421. * isupper: (libc)Classification of Characters.
  1422. * iswalnum: (libc)Classification of Wide Characters.
  1423. * iswalpha: (libc)Classification of Wide Characters.
  1424. * iswblank: (libc)Classification of Wide Characters.
  1425. * iswcntrl: (libc)Classification of Wide Characters.
  1426. * iswctype: (libc)Classification of Wide Characters.
  1427. * iswdigit: (libc)Classification of Wide Characters.
  1428. * iswgraph: (libc)Classification of Wide Characters.
  1429. * iswlower: (libc)Classification of Wide Characters.
  1430. * iswprint: (libc)Classification of Wide Characters.
  1431. * iswpunct: (libc)Classification of Wide Characters.
  1432. * iswspace: (libc)Classification of Wide Characters.
  1433. * iswupper: (libc)Classification of Wide Characters.
  1434. * iswxdigit: (libc)Classification of Wide Characters.
  1435. * isxdigit: (libc)Classification of Characters.
  1436. * iszero: (libc)Floating Point Classes.
  1437. * j0: (libc)Special Functions.
  1438. * j0f: (libc)Special Functions.
  1439. * j0fN: (libc)Special Functions.
  1440. * j0fNx: (libc)Special Functions.
  1441. * j0l: (libc)Special Functions.
  1442. * j1: (libc)Special Functions.
  1443. * j1f: (libc)Special Functions.
  1444. * j1fN: (libc)Special Functions.
  1445. * j1fNx: (libc)Special Functions.
  1446. * j1l: (libc)Special Functions.
  1447. * jn: (libc)Special Functions.
  1448. * jnf: (libc)Special Functions.
  1449. * jnfN: (libc)Special Functions.
  1450. * jnfNx: (libc)Special Functions.
  1451. * jnl: (libc)Special Functions.
  1452. * jrand48: (libc)SVID Random.
  1453. * jrand48_r: (libc)SVID Random.
  1454. * kill: (libc)Signaling Another Process.
  1455. * killpg: (libc)Signaling Another Process.
  1456. * l64a: (libc)Encode Binary Data.
  1457. * labs: (libc)Absolute Value.
  1458. * lcong48: (libc)SVID Random.
  1459. * lcong48_r: (libc)SVID Random.
  1460. * ldexp: (libc)Normalization Functions.
  1461. * ldexpf: (libc)Normalization Functions.
  1462. * ldexpfN: (libc)Normalization Functions.
  1463. * ldexpfNx: (libc)Normalization Functions.
  1464. * ldexpl: (libc)Normalization Functions.
  1465. * ldiv: (libc)Integer Division.
  1466. * lfind: (libc)Array Search Function.
  1467. * lgamma: (libc)Special Functions.
  1468. * lgamma_r: (libc)Special Functions.
  1469. * lgammaf: (libc)Special Functions.
  1470. * lgammafN: (libc)Special Functions.
  1471. * lgammafN_r: (libc)Special Functions.
  1472. * lgammafNx: (libc)Special Functions.
  1473. * lgammafNx_r: (libc)Special Functions.
  1474. * lgammaf_r: (libc)Special Functions.
  1475. * lgammal: (libc)Special Functions.
  1476. * lgammal_r: (libc)Special Functions.
  1477. * link: (libc)Hard Links.
  1478. * linkat: (libc)Hard Links.
  1479. * lio_listio64: (libc)Asynchronous Reads/Writes.
  1480. * lio_listio: (libc)Asynchronous Reads/Writes.
  1481. * listen: (libc)Listening.
  1482. * llabs: (libc)Absolute Value.
  1483. * lldiv: (libc)Integer Division.
  1484. * llogb: (libc)Exponents and Logarithms.
  1485. * llogbf: (libc)Exponents and Logarithms.
  1486. * llogbfN: (libc)Exponents and Logarithms.
  1487. * llogbfNx: (libc)Exponents and Logarithms.
  1488. * llogbl: (libc)Exponents and Logarithms.
  1489. * llrint: (libc)Rounding Functions.
  1490. * llrintf: (libc)Rounding Functions.
  1491. * llrintfN: (libc)Rounding Functions.
  1492. * llrintfNx: (libc)Rounding Functions.
  1493. * llrintl: (libc)Rounding Functions.
  1494. * llround: (libc)Rounding Functions.
  1495. * llroundf: (libc)Rounding Functions.
  1496. * llroundfN: (libc)Rounding Functions.
  1497. * llroundfNx: (libc)Rounding Functions.
  1498. * llroundl: (libc)Rounding Functions.
  1499. * localeconv: (libc)The Lame Way to Locale Data.
  1500. * localtime: (libc)Broken-down Time.
  1501. * localtime_r: (libc)Broken-down Time.
  1502. * log10: (libc)Exponents and Logarithms.
  1503. * log10f: (libc)Exponents and Logarithms.
  1504. * log10fN: (libc)Exponents and Logarithms.
  1505. * log10fNx: (libc)Exponents and Logarithms.
  1506. * log10l: (libc)Exponents and Logarithms.
  1507. * log10p1: (libc)Exponents and Logarithms.
  1508. * log10p1f: (libc)Exponents and Logarithms.
  1509. * log10p1fN: (libc)Exponents and Logarithms.
  1510. * log10p1fNx: (libc)Exponents and Logarithms.
  1511. * log10p1l: (libc)Exponents and Logarithms.
  1512. * log1p: (libc)Exponents and Logarithms.
  1513. * log1pf: (libc)Exponents and Logarithms.
  1514. * log1pfN: (libc)Exponents and Logarithms.
  1515. * log1pfNx: (libc)Exponents and Logarithms.
  1516. * log1pl: (libc)Exponents and Logarithms.
  1517. * log2: (libc)Exponents and Logarithms.
  1518. * log2f: (libc)Exponents and Logarithms.
  1519. * log2fN: (libc)Exponents and Logarithms.
  1520. * log2fNx: (libc)Exponents and Logarithms.
  1521. * log2l: (libc)Exponents and Logarithms.
  1522. * log2p1: (libc)Exponents and Logarithms.
  1523. * log2p1f: (libc)Exponents and Logarithms.
  1524. * log2p1fN: (libc)Exponents and Logarithms.
  1525. * log2p1fNx: (libc)Exponents and Logarithms.
  1526. * log2p1l: (libc)Exponents and Logarithms.
  1527. * log: (libc)Exponents and Logarithms.
  1528. * logb: (libc)Exponents and Logarithms.
  1529. * logbf: (libc)Exponents and Logarithms.
  1530. * logbfN: (libc)Exponents and Logarithms.
  1531. * logbfNx: (libc)Exponents and Logarithms.
  1532. * logbl: (libc)Exponents and Logarithms.
  1533. * logf: (libc)Exponents and Logarithms.
  1534. * logfN: (libc)Exponents and Logarithms.
  1535. * logfNx: (libc)Exponents and Logarithms.
  1536. * login: (libc)Logging In and Out.
  1537. * login_tty: (libc)Logging In and Out.
  1538. * logl: (libc)Exponents and Logarithms.
  1539. * logout: (libc)Logging In and Out.
  1540. * logp1: (libc)Exponents and Logarithms.
  1541. * logp1f: (libc)Exponents and Logarithms.
  1542. * logp1fN: (libc)Exponents and Logarithms.
  1543. * logp1fNx: (libc)Exponents and Logarithms.
  1544. * logp1l: (libc)Exponents and Logarithms.
  1545. * logwtmp: (libc)Logging In and Out.
  1546. * longjmp: (libc)Non-Local Details.
  1547. * lrand48: (libc)SVID Random.
  1548. * lrand48_r: (libc)SVID Random.
  1549. * lrint: (libc)Rounding Functions.
  1550. * lrintf: (libc)Rounding Functions.
  1551. * lrintfN: (libc)Rounding Functions.
  1552. * lrintfNx: (libc)Rounding Functions.
  1553. * lrintl: (libc)Rounding Functions.
  1554. * lround: (libc)Rounding Functions.
  1555. * lroundf: (libc)Rounding Functions.
  1556. * lroundfN: (libc)Rounding Functions.
  1557. * lroundfNx: (libc)Rounding Functions.
  1558. * lroundl: (libc)Rounding Functions.
  1559. * lsearch: (libc)Array Search Function.
  1560. * lseek64: (libc)File Position Primitive.
  1561. * lseek: (libc)File Position Primitive.
  1562. * lstat64: (libc)Reading Attributes.
  1563. * lstat: (libc)Reading Attributes.
  1564. * lutimes: (libc)File Times.
  1565. * madvise: (libc)Memory-mapped I/O.
  1566. * makecontext: (libc)System V contexts.
  1567. * mallinfo2: (libc)Statistics of Malloc.
  1568. * malloc: (libc)Basic Allocation.
  1569. * mallopt: (libc)Malloc Tunable Parameters.
  1570. * mblen: (libc)Non-reentrant Character Conversion.
  1571. * mbrlen: (libc)Converting a Character.
  1572. * mbrtowc: (libc)Converting a Character.
  1573. * mbsinit: (libc)Keeping the state.
  1574. * mbsnrtowcs: (libc)Converting Strings.
  1575. * mbsrtowcs: (libc)Converting Strings.
  1576. * mbstowcs: (libc)Non-reentrant String Conversion.
  1577. * mbtowc: (libc)Non-reentrant Character Conversion.
  1578. * mcheck: (libc)Heap Consistency Checking.
  1579. * memalign: (libc)Aligned Memory Blocks.
  1580. * memalignment: (libc)Aligned Memory Blocks.
  1581. * memccpy: (libc)Copying Strings and Arrays.
  1582. * memchr: (libc)Search Functions.
  1583. * memcmp: (libc)String/Array Comparison.
  1584. * memcpy: (libc)Copying Strings and Arrays.
  1585. * memfd_create: (libc)Memory-mapped I/O.
  1586. * memfrob: (libc)Obfuscating Data.
  1587. * memmem: (libc)Search Functions.
  1588. * memmove: (libc)Copying Strings and Arrays.
  1589. * mempcpy: (libc)Copying Strings and Arrays.
  1590. * memrchr: (libc)Search Functions.
  1591. * memset: (libc)Copying Strings and Arrays.
  1592. * memset_explicit: (libc)Erasing Sensitive Data.
  1593. * mkdir: (libc)Creating Directories.
  1594. * mkdirat: (libc)Creating Directories.
  1595. * mkdtemp: (libc)Temporary Files.
  1596. * mkfifo: (libc)FIFO Special Files.
  1597. * mknod: (libc)Making Special Files.
  1598. * mkstemp: (libc)Temporary Files.
  1599. * mktemp: (libc)Temporary Files.
  1600. * mktime: (libc)Broken-down Time.
  1601. * mlock2: (libc)Page Lock Functions.
  1602. * mlock: (libc)Page Lock Functions.
  1603. * mlockall: (libc)Page Lock Functions.
  1604. * mmap64: (libc)Memory-mapped I/O.
  1605. * mmap: (libc)Memory-mapped I/O.
  1606. * modf: (libc)Rounding Functions.
  1607. * modff: (libc)Rounding Functions.
  1608. * modffN: (libc)Rounding Functions.
  1609. * modffNx: (libc)Rounding Functions.
  1610. * modfl: (libc)Rounding Functions.
  1611. * mount: (libc)Mount-Unmount-Remount.
  1612. * mprobe: (libc)Heap Consistency Checking.
  1613. * mprotect: (libc)Memory Protection.
  1614. * mrand48: (libc)SVID Random.
  1615. * mrand48_r: (libc)SVID Random.
  1616. * mremap: (libc)Memory-mapped I/O.
  1617. * mseal: (libc)Memory Protection.
  1618. * msync: (libc)Memory-mapped I/O.
  1619. * mtrace: (libc)Tracing malloc.
  1620. * mtx_destroy: (libc)ISO C Mutexes.
  1621. * mtx_init: (libc)ISO C Mutexes.
  1622. * mtx_lock: (libc)ISO C Mutexes.
  1623. * mtx_timedlock: (libc)ISO C Mutexes.
  1624. * mtx_trylock: (libc)ISO C Mutexes.
  1625. * mtx_unlock: (libc)ISO C Mutexes.
  1626. * munlock: (libc)Page Lock Functions.
  1627. * munlockall: (libc)Page Lock Functions.
  1628. * munmap: (libc)Memory-mapped I/O.
  1629. * muntrace: (libc)Tracing malloc.
  1630. * nan: (libc)FP Bit Twiddling.
  1631. * nanf: (libc)FP Bit Twiddling.
  1632. * nanfN: (libc)FP Bit Twiddling.
  1633. * nanfNx: (libc)FP Bit Twiddling.
  1634. * nanl: (libc)FP Bit Twiddling.
  1635. * nanosleep: (libc)Sleeping.
  1636. * nearbyint: (libc)Rounding Functions.
  1637. * nearbyintf: (libc)Rounding Functions.
  1638. * nearbyintfN: (libc)Rounding Functions.
  1639. * nearbyintfNx: (libc)Rounding Functions.
  1640. * nearbyintl: (libc)Rounding Functions.
  1641. * nextafter: (libc)FP Bit Twiddling.
  1642. * nextafterf: (libc)FP Bit Twiddling.
  1643. * nextafterfN: (libc)FP Bit Twiddling.
  1644. * nextafterfNx: (libc)FP Bit Twiddling.
  1645. * nextafterl: (libc)FP Bit Twiddling.
  1646. * nextdown: (libc)FP Bit Twiddling.
  1647. * nextdownf: (libc)FP Bit Twiddling.
  1648. * nextdownfN: (libc)FP Bit Twiddling.
  1649. * nextdownfNx: (libc)FP Bit Twiddling.
  1650. * nextdownl: (libc)FP Bit Twiddling.
  1651. * nexttoward: (libc)FP Bit Twiddling.
  1652. * nexttowardf: (libc)FP Bit Twiddling.
  1653. * nexttowardl: (libc)FP Bit Twiddling.
  1654. * nextup: (libc)FP Bit Twiddling.
  1655. * nextupf: (libc)FP Bit Twiddling.
  1656. * nextupfN: (libc)FP Bit Twiddling.
  1657. * nextupfNx: (libc)FP Bit Twiddling.
  1658. * nextupl: (libc)FP Bit Twiddling.
  1659. * nftw64: (libc)Working with Directory Trees.
  1660. * nftw: (libc)Working with Directory Trees.
  1661. * ngettext: (libc)Advanced gettext functions.
  1662. * nice: (libc)Traditional Scheduling Functions.
  1663. * nl_langinfo: (libc)The Elegant and Fast Way.
  1664. * nrand48: (libc)SVID Random.
  1665. * nrand48_r: (libc)SVID Random.
  1666. * ntohl: (libc)Byte Order.
  1667. * ntohs: (libc)Byte Order.
  1668. * ntp_adjtime: (libc)Setting and Adjusting the Time.
  1669. * ntp_gettime: (libc)Setting and Adjusting the Time.
  1670. * obstack_1grow: (libc)Growing Objects.
  1671. * obstack_1grow_fast: (libc)Extra Fast Growing.
  1672. * obstack_alignment_mask: (libc)Obstacks Data Alignment.
  1673. * obstack_alloc: (libc)Allocation in an Obstack.
  1674. * obstack_base: (libc)Status of an Obstack.
  1675. * obstack_blank: (libc)Growing Objects.
  1676. * obstack_blank_fast: (libc)Extra Fast Growing.
  1677. * obstack_chunk_size: (libc)Obstack Chunks.
  1678. * obstack_copy0: (libc)Allocation in an Obstack.
  1679. * obstack_copy: (libc)Allocation in an Obstack.
  1680. * obstack_finish: (libc)Growing Objects.
  1681. * obstack_free: (libc)Freeing Obstack Objects.
  1682. * obstack_grow0: (libc)Growing Objects.
  1683. * obstack_grow: (libc)Growing Objects.
  1684. * obstack_init: (libc)Preparing for Obstacks.
  1685. * obstack_int_grow: (libc)Growing Objects.
  1686. * obstack_int_grow_fast: (libc)Extra Fast Growing.
  1687. * obstack_next_free: (libc)Status of an Obstack.
  1688. * obstack_object_size: (libc)Growing Objects.
  1689. * obstack_object_size: (libc)Status of an Obstack.
  1690. * obstack_printf: (libc)Dynamic Output.
  1691. * obstack_ptr_grow: (libc)Growing Objects.
  1692. * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
  1693. * obstack_room: (libc)Extra Fast Growing.
  1694. * obstack_vprintf: (libc)Variable Arguments Output.
  1695. * offsetof: (libc)Structure Measurement.
  1696. * on_exit: (libc)Cleanups on Exit.
  1697. * open64: (libc)Opening and Closing Files.
  1698. * open: (libc)Opening and Closing Files.
  1699. * open_memstream: (libc)String Streams.
  1700. * openat2: (libc)Opening and Closing Files.
  1701. * openat64: (libc)Opening and Closing Files.
  1702. * openat: (libc)Opening and Closing Files.
  1703. * opendir: (libc)Opening a Directory.
  1704. * openlog: (libc)openlog.
  1705. * openpty: (libc)Pseudo-Terminal Pairs.
  1706. * parse_printf_format: (libc)Parsing a Template String.
  1707. * pathconf: (libc)Pathconf.
  1708. * pause: (libc)Using Pause.
  1709. * pclose: (libc)Pipe to a Subprocess.
  1710. * perror: (libc)Error Messages.
  1711. * pidfd_getpid: (libc)Querying a Process.
  1712. * pipe: (libc)Creating a Pipe.
  1713. * pkey_alloc: (libc)Memory Protection.
  1714. * pkey_free: (libc)Memory Protection.
  1715. * pkey_get: (libc)Memory Protection.
  1716. * pkey_mprotect: (libc)Memory Protection.
  1717. * pkey_set: (libc)Memory Protection.
  1718. * poll: (libc)Other Low-Level I/O APIs.
  1719. * popen: (libc)Pipe to a Subprocess.
  1720. * posix_fallocate64: (libc)Storage Allocation.
  1721. * posix_fallocate: (libc)Storage Allocation.
  1722. * posix_memalign: (libc)Aligned Memory Blocks.
  1723. * posix_openpt: (libc)Allocation.
  1724. * pow: (libc)Exponents and Logarithms.
  1725. * powf: (libc)Exponents and Logarithms.
  1726. * powfN: (libc)Exponents and Logarithms.
  1727. * powfNx: (libc)Exponents and Logarithms.
  1728. * powl: (libc)Exponents and Logarithms.
  1729. * pown: (libc)Exponents and Logarithms.
  1730. * pownf: (libc)Exponents and Logarithms.
  1731. * pownfN: (libc)Exponents and Logarithms.
  1732. * pownfNx: (libc)Exponents and Logarithms.
  1733. * pownl: (libc)Exponents and Logarithms.
  1734. * powr: (libc)Exponents and Logarithms.
  1735. * powrf: (libc)Exponents and Logarithms.
  1736. * powrfN: (libc)Exponents and Logarithms.
  1737. * powrfNx: (libc)Exponents and Logarithms.
  1738. * powrl: (libc)Exponents and Logarithms.
  1739. * pread64: (libc)I/O Primitives.
  1740. * pread: (libc)I/O Primitives.
  1741. * preadv2: (libc)Scatter-Gather.
  1742. * preadv64: (libc)Scatter-Gather.
  1743. * preadv64v2: (libc)Scatter-Gather.
  1744. * preadv: (libc)Scatter-Gather.
  1745. * printf: (libc)Formatted Output Functions.
  1746. * printf_size: (libc)Predefined Printf Handlers.
  1747. * printf_size_info: (libc)Predefined Printf Handlers.
  1748. * psignal: (libc)Signal Messages.
  1749. * pthread_attr_destroy: (libc)Creating and Destroying Threads.
  1750. * pthread_attr_getaffinity_np: (libc)Thread CPU Affinity.
  1751. * pthread_attr_getdetachstate: (libc)Creating and Destroying Threads.
  1752. * pthread_attr_getsigmask_np: (libc)Initial Thread Signal Mask.
  1753. * pthread_attr_init: (libc)Creating and Destroying Threads.
  1754. * pthread_attr_setaffinity_np: (libc)Thread CPU Affinity.
  1755. * pthread_attr_setdetachstate: (libc)Creating and Destroying Threads.
  1756. * pthread_attr_setsigmask_np: (libc)Initial Thread Signal Mask.
  1757. * pthread_barrier_destroy: (libc)POSIX Barriers.
  1758. * pthread_barrier_init: (libc)POSIX Barriers.
  1759. * pthread_barrier_wait: (libc)POSIX Barriers.
  1760. * pthread_clockjoin_np: (libc)Joining Threads.
  1761. * pthread_cond_clockwait: (libc)Waiting with Explicit Clocks.
  1762. * pthread_create: (libc)Creating and Destroying Threads.
  1763. * pthread_detach: (libc)Creating and Destroying Threads.
  1764. * pthread_equal: (libc)POSIX Threads Other APIs.
  1765. * pthread_getaffinity_np: (libc)Thread CPU Affinity.
  1766. * pthread_getattr_default_np: (libc)Default Thread Attributes.
  1767. * pthread_getcpuclockid: (libc)POSIX Threads Other APIs.
  1768. * pthread_getname_np: (libc)Thread Names.
  1769. * pthread_getspecific: (libc)Thread-specific Data.
  1770. * pthread_gettid_np: (libc)Process Identification.
  1771. * pthread_join: (libc)Creating and Destroying Threads.
  1772. * pthread_key_create: (libc)Thread-specific Data.
  1773. * pthread_key_delete: (libc)Thread-specific Data.
  1774. * pthread_kill: (libc)Creating and Destroying Threads.
  1775. * pthread_mutex_clocklock: (libc)POSIX Mutexes.
  1776. * pthread_mutex_destroy: (libc)POSIX Mutexes.
  1777. * pthread_mutex_init: (libc)POSIX Mutexes.
  1778. * pthread_mutex_lock: (libc)POSIX Mutexes.
  1779. * pthread_mutex_timedlock: (libc)POSIX Mutexes.
  1780. * pthread_mutex_trylock: (libc)POSIX Mutexes.
  1781. * pthread_mutex_unlock: (libc)POSIX Mutexes.
  1782. * pthread_mutexattr_destroy: (libc)POSIX Mutexes.
  1783. * pthread_mutexattr_gettype: (libc)POSIX Mutexes.
  1784. * pthread_mutexattr_init: (libc)POSIX Mutexes.
  1785. * pthread_mutexattr_settype: (libc)POSIX Mutexes.
  1786. * pthread_once: (libc)POSIX Threads Other APIs.
  1787. * pthread_rwlock_clockrdlock: (libc)Waiting with Explicit Clocks.
  1788. * pthread_rwlock_clockwrlock: (libc)Waiting with Explicit Clocks.
  1789. * pthread_self: (libc)Creating and Destroying Threads.
  1790. * pthread_setaffinity_np: (libc)Thread CPU Affinity.
  1791. * pthread_setattr_default_np: (libc)Default Thread Attributes.
  1792. * pthread_setname_np: (libc)Thread Names.
  1793. * pthread_setspecific: (libc)Thread-specific Data.
  1794. * pthread_sigmask: (libc)POSIX Threads Other APIs.
  1795. * pthread_spin_destroy: (libc)POSIX Spin Locks.
  1796. * pthread_spin_init: (libc)POSIX Spin Locks.
  1797. * pthread_spin_lock: (libc)POSIX Spin Locks.
  1798. * pthread_spin_trylock: (libc)POSIX Spin Locks.
  1799. * pthread_spin_unlock: (libc)POSIX Spin Locks.
  1800. * pthread_timedjoin_np: (libc)Joining Threads.
  1801. * pthread_tryjoin_np: (libc)Joining Threads.
  1802. * ptsname: (libc)Allocation.
  1803. * ptsname_r: (libc)Allocation.
  1804. * putc: (libc)Simple Output.
  1805. * putc_unlocked: (libc)Simple Output.
  1806. * putchar: (libc)Simple Output.
  1807. * putchar_unlocked: (libc)Simple Output.
  1808. * putenv: (libc)Environment Access.
  1809. * putpwent: (libc)Writing a User Entry.
  1810. * puts: (libc)Simple Output.
  1811. * pututline: (libc)Manipulating the Database.
  1812. * pututxline: (libc)XPG Functions.
  1813. * putw: (libc)Simple Output.
  1814. * putwc: (libc)Simple Output.
  1815. * putwc_unlocked: (libc)Simple Output.
  1816. * putwchar: (libc)Simple Output.
  1817. * putwchar_unlocked: (libc)Simple Output.
  1818. * pwrite64: (libc)I/O Primitives.
  1819. * pwrite: (libc)I/O Primitives.
  1820. * pwritev2: (libc)Scatter-Gather.
  1821. * pwritev64: (libc)Scatter-Gather.
  1822. * pwritev64v2: (libc)Scatter-Gather.
  1823. * pwritev: (libc)Scatter-Gather.
  1824. * qecvt: (libc)System V Number Conversion.
  1825. * qecvt_r: (libc)System V Number Conversion.
  1826. * qfcvt: (libc)System V Number Conversion.
  1827. * qfcvt_r: (libc)System V Number Conversion.
  1828. * qgcvt: (libc)System V Number Conversion.
  1829. * qsort: (libc)Array Sort Function.
  1830. * raise: (libc)Signaling Yourself.
  1831. * rand: (libc)ISO Random.
  1832. * rand_r: (libc)ISO Random.
  1833. * random: (libc)BSD Random.
  1834. * random_r: (libc)BSD Random.
  1835. * rawmemchr: (libc)Search Functions.
  1836. * read: (libc)I/O Primitives.
  1837. * readdir64: (libc)Reading/Closing Directory.
  1838. * readdir64_r: (libc)Reading/Closing Directory.
  1839. * readdir: (libc)Reading/Closing Directory.
  1840. * readdir_r: (libc)Reading/Closing Directory.
  1841. * readlink: (libc)Symbolic Links.
  1842. * readv: (libc)Scatter-Gather.
  1843. * realloc: (libc)Changing Block Size.
  1844. * reallocarray: (libc)Changing Block Size.
  1845. * realpath: (libc)Symbolic Links.
  1846. * recv: (libc)Receiving Data.
  1847. * recvfrom: (libc)Receiving Datagrams.
  1848. * recvmsg: (libc)Other Socket APIs.
  1849. * regcomp: (libc)POSIX Regexp Compilation.
  1850. * regerror: (libc)Regexp Cleanup.
  1851. * regexec: (libc)Matching POSIX Regexps.
  1852. * regfree: (libc)Regexp Cleanup.
  1853. * register_printf_function: (libc)Registering New Conversions.
  1854. * remainder: (libc)Remainder Functions.
  1855. * remainderf: (libc)Remainder Functions.
  1856. * remainderfN: (libc)Remainder Functions.
  1857. * remainderfNx: (libc)Remainder Functions.
  1858. * remainderl: (libc)Remainder Functions.
  1859. * remove: (libc)Deleting Files.
  1860. * rename: (libc)Renaming Files.
  1861. * renameat: (libc)Renaming Files.
  1862. * rewind: (libc)File Positioning.
  1863. * rewinddir: (libc)Random Access Directory.
  1864. * rindex: (libc)Search Functions.
  1865. * rint: (libc)Rounding Functions.
  1866. * rintf: (libc)Rounding Functions.
  1867. * rintfN: (libc)Rounding Functions.
  1868. * rintfNx: (libc)Rounding Functions.
  1869. * rintl: (libc)Rounding Functions.
  1870. * rmdir: (libc)Deleting Files.
  1871. * rootn: (libc)Exponents and Logarithms.
  1872. * rootnf: (libc)Exponents and Logarithms.
  1873. * rootnfN: (libc)Exponents and Logarithms.
  1874. * rootnfNx: (libc)Exponents and Logarithms.
  1875. * rootnl: (libc)Exponents and Logarithms.
  1876. * round: (libc)Rounding Functions.
  1877. * roundeven: (libc)Rounding Functions.
  1878. * roundevenf: (libc)Rounding Functions.
  1879. * roundevenfN: (libc)Rounding Functions.
  1880. * roundevenfNx: (libc)Rounding Functions.
  1881. * roundevenl: (libc)Rounding Functions.
  1882. * roundf: (libc)Rounding Functions.
  1883. * roundfN: (libc)Rounding Functions.
  1884. * roundfNx: (libc)Rounding Functions.
  1885. * roundl: (libc)Rounding Functions.
  1886. * rpmatch: (libc)Yes-or-No Questions.
  1887. * rsqrt: (libc)Exponents and Logarithms.
  1888. * rsqrtf: (libc)Exponents and Logarithms.
  1889. * rsqrtfN: (libc)Exponents and Logarithms.
  1890. * rsqrtfNx: (libc)Exponents and Logarithms.
  1891. * rsqrtl: (libc)Exponents and Logarithms.
  1892. * sbrk: (libc)Resizing the Data Segment.
  1893. * scalb: (libc)Normalization Functions.
  1894. * scalbf: (libc)Normalization Functions.
  1895. * scalbl: (libc)Normalization Functions.
  1896. * scalbln: (libc)Normalization Functions.
  1897. * scalblnf: (libc)Normalization Functions.
  1898. * scalblnfN: (libc)Normalization Functions.
  1899. * scalblnfNx: (libc)Normalization Functions.
  1900. * scalblnl: (libc)Normalization Functions.
  1901. * scalbn: (libc)Normalization Functions.
  1902. * scalbnf: (libc)Normalization Functions.
  1903. * scalbnfN: (libc)Normalization Functions.
  1904. * scalbnfNx: (libc)Normalization Functions.
  1905. * scalbnl: (libc)Normalization Functions.
  1906. * scandir64: (libc)Scanning Directory Content.
  1907. * scandir: (libc)Scanning Directory Content.
  1908. * scanf: (libc)Formatted Input Functions.
  1909. * sched_get_priority_max: (libc)Basic Scheduling Functions.
  1910. * sched_get_priority_min: (libc)Basic Scheduling Functions.
  1911. * sched_getaffinity: (libc)CPU Affinity.
  1912. * sched_getattr: (libc)Extensible Scheduling.
  1913. * sched_getcpu: (libc)CPU Affinity.
  1914. * sched_getparam: (libc)Basic Scheduling Functions.
  1915. * sched_getscheduler: (libc)Basic Scheduling Functions.
  1916. * sched_rr_get_interval: (libc)Basic Scheduling Functions.
  1917. * sched_setaffinity: (libc)CPU Affinity.
  1918. * sched_setattr: (libc)Extensible Scheduling.
  1919. * sched_setparam: (libc)Basic Scheduling Functions.
  1920. * sched_setscheduler: (libc)Basic Scheduling Functions.
  1921. * sched_yield: (libc)Basic Scheduling Functions.
  1922. * secure_getenv: (libc)Environment Access.
  1923. * seed48: (libc)SVID Random.
  1924. * seed48_r: (libc)SVID Random.
  1925. * seekdir: (libc)Random Access Directory.
  1926. * select: (libc)Waiting for I/O.
  1927. * sem_clockwait: (libc)POSIX Semaphores.
  1928. * sem_close: (libc)POSIX Semaphores.
  1929. * sem_destroy: (libc)POSIX Semaphores.
  1930. * sem_getvalue: (libc)POSIX Semaphores.
  1931. * sem_init: (libc)POSIX Semaphores.
  1932. * sem_open: (libc)POSIX Semaphores.
  1933. * sem_post: (libc)POSIX Semaphores.
  1934. * sem_timedwait: (libc)POSIX Semaphores.
  1935. * sem_trywait: (libc)POSIX Semaphores.
  1936. * sem_unlink: (libc)POSIX Semaphores.
  1937. * sem_wait: (libc)POSIX Semaphores.
  1938. * semctl: (libc)Semaphores.
  1939. * semget: (libc)Semaphores.
  1940. * semop: (libc)Semaphores.
  1941. * semtimedop: (libc)Semaphores.
  1942. * send: (libc)Sending Data.
  1943. * sendmsg: (libc)Other Socket APIs.
  1944. * sendto: (libc)Sending Datagrams.
  1945. * setbuf: (libc)Controlling Buffering.
  1946. * setbuffer: (libc)Controlling Buffering.
  1947. * setcontext: (libc)System V contexts.
  1948. * setdomainname: (libc)Host Identification.
  1949. * setegid: (libc)Setting Groups.
  1950. * setenv: (libc)Environment Access.
  1951. * seteuid: (libc)Setting User ID.
  1952. * setfsent: (libc)fstab.
  1953. * setgid: (libc)Setting Groups.
  1954. * setgrent: (libc)Scanning All Groups.
  1955. * setgroups: (libc)Setting Groups.
  1956. * sethostent: (libc)Host Names.
  1957. * sethostid: (libc)Host Identification.
  1958. * sethostname: (libc)Host Identification.
  1959. * setitimer: (libc)Setting an Alarm.
  1960. * setjmp: (libc)Non-Local Details.
  1961. * setlinebuf: (libc)Controlling Buffering.
  1962. * setlocale: (libc)Setting the Locale.
  1963. * setlogmask: (libc)setlogmask.
  1964. * setmntent: (libc)mtab.
  1965. * setnetent: (libc)Networks Database.
  1966. * setnetgrent: (libc)Lookup Netgroup.
  1967. * setpayload: (libc)FP Bit Twiddling.
  1968. * setpayloadf: (libc)FP Bit Twiddling.
  1969. * setpayloadfN: (libc)FP Bit Twiddling.
  1970. * setpayloadfNx: (libc)FP Bit Twiddling.
  1971. * setpayloadl: (libc)FP Bit Twiddling.
  1972. * setpayloadsig: (libc)FP Bit Twiddling.
  1973. * setpayloadsigf: (libc)FP Bit Twiddling.
  1974. * setpayloadsigfN: (libc)FP Bit Twiddling.
  1975. * setpayloadsigfNx: (libc)FP Bit Twiddling.
  1976. * setpayloadsigl: (libc)FP Bit Twiddling.
  1977. * setpgid: (libc)Process Group Functions.
  1978. * setpgrp: (libc)Process Group Functions.
  1979. * setpriority: (libc)Traditional Scheduling Functions.
  1980. * setprotoent: (libc)Protocols Database.
  1981. * setpwent: (libc)Scanning All Users.
  1982. * setregid: (libc)Setting Groups.
  1983. * setreuid: (libc)Setting User ID.
  1984. * setrlimit64: (libc)Limits on Resources.
  1985. * setrlimit: (libc)Limits on Resources.
  1986. * setservent: (libc)Services Database.
  1987. * setsid: (libc)Process Group Functions.
  1988. * setsockopt: (libc)Socket Option Functions.
  1989. * setstate: (libc)BSD Random.
  1990. * setstate_r: (libc)BSD Random.
  1991. * settimeofday: (libc)Setting and Adjusting the Time.
  1992. * setuid: (libc)Setting User ID.
  1993. * setutent: (libc)Manipulating the Database.
  1994. * setutxent: (libc)XPG Functions.
  1995. * setvbuf: (libc)Controlling Buffering.
  1996. * shm_open: (libc)Memory-mapped I/O.
  1997. * shm_unlink: (libc)Memory-mapped I/O.
  1998. * shutdown: (libc)Closing a Socket.
  1999. * sigabbrev_np: (libc)Signal Messages.
  2000. * sigaction: (libc)Advanced Signal Handling.
  2001. * sigaddset: (libc)Signal Sets.
  2002. * sigaltstack: (libc)Signal Stack.
  2003. * sigblock: (libc)BSD Signal Handling.
  2004. * sigdelset: (libc)Signal Sets.
  2005. * sigdescr_np: (libc)Signal Messages.
  2006. * sigemptyset: (libc)Signal Sets.
  2007. * sigfillset: (libc)Signal Sets.
  2008. * siginterrupt: (libc)BSD Signal Handling.
  2009. * sigismember: (libc)Signal Sets.
  2010. * siglongjmp: (libc)Non-Local Exits and Signals.
  2011. * sigmask: (libc)BSD Signal Handling.
  2012. * signal: (libc)Basic Signal Handling.
  2013. * signbit: (libc)FP Bit Twiddling.
  2014. * significand: (libc)Normalization Functions.
  2015. * significandf: (libc)Normalization Functions.
  2016. * significandl: (libc)Normalization Functions.
  2017. * sigpause: (libc)BSD Signal Handling.
  2018. * sigpending: (libc)Checking for Pending Signals.
  2019. * sigprocmask: (libc)Process Signal Mask.
  2020. * sigsetjmp: (libc)Non-Local Exits and Signals.
  2021. * sigsetmask: (libc)BSD Signal Handling.
  2022. * sigstack: (libc)Signal Stack.
  2023. * sigsuspend: (libc)Sigsuspend.
  2024. * sin: (libc)Trig Functions.
  2025. * sincos: (libc)Trig Functions.
  2026. * sincosf: (libc)Trig Functions.
  2027. * sincosfN: (libc)Trig Functions.
  2028. * sincosfNx: (libc)Trig Functions.
  2029. * sincosl: (libc)Trig Functions.
  2030. * sinf: (libc)Trig Functions.
  2031. * sinfN: (libc)Trig Functions.
  2032. * sinfNx: (libc)Trig Functions.
  2033. * sinh: (libc)Hyperbolic Functions.
  2034. * sinhf: (libc)Hyperbolic Functions.
  2035. * sinhfN: (libc)Hyperbolic Functions.
  2036. * sinhfNx: (libc)Hyperbolic Functions.
  2037. * sinhl: (libc)Hyperbolic Functions.
  2038. * sinl: (libc)Trig Functions.
  2039. * sinpi: (libc)Trig Functions.
  2040. * sinpif: (libc)Trig Functions.
  2041. * sinpifN: (libc)Trig Functions.
  2042. * sinpifNx: (libc)Trig Functions.
  2043. * sinpil: (libc)Trig Functions.
  2044. * sleep: (libc)Sleeping.
  2045. * snprintf: (libc)Formatted Output Functions.
  2046. * socket: (libc)Creating a Socket.
  2047. * socketpair: (libc)Socket Pairs.
  2048. * sprintf: (libc)Formatted Output Functions.
  2049. * sqrt: (libc)Exponents and Logarithms.
  2050. * sqrtf: (libc)Exponents and Logarithms.
  2051. * sqrtfN: (libc)Exponents and Logarithms.
  2052. * sqrtfNx: (libc)Exponents and Logarithms.
  2053. * sqrtl: (libc)Exponents and Logarithms.
  2054. * srand48: (libc)SVID Random.
  2055. * srand48_r: (libc)SVID Random.
  2056. * srand: (libc)ISO Random.
  2057. * srandom: (libc)BSD Random.
  2058. * srandom_r: (libc)BSD Random.
  2059. * sscanf: (libc)Formatted Input Functions.
  2060. * ssignal: (libc)Basic Signal Handling.
  2061. * stat64: (libc)Reading Attributes.
  2062. * stat: (libc)Reading Attributes.
  2063. * stdc_bit_ceil_uc: (libc)Bit Manipulation.
  2064. * stdc_bit_ceil_ui: (libc)Bit Manipulation.
  2065. * stdc_bit_ceil_ul: (libc)Bit Manipulation.
  2066. * stdc_bit_ceil_ull: (libc)Bit Manipulation.
  2067. * stdc_bit_ceil_us: (libc)Bit Manipulation.
  2068. * stdc_bit_floor_uc: (libc)Bit Manipulation.
  2069. * stdc_bit_floor_ui: (libc)Bit Manipulation.
  2070. * stdc_bit_floor_ul: (libc)Bit Manipulation.
  2071. * stdc_bit_floor_ull: (libc)Bit Manipulation.
  2072. * stdc_bit_floor_us: (libc)Bit Manipulation.
  2073. * stdc_bit_width_uc: (libc)Bit Manipulation.
  2074. * stdc_bit_width_ui: (libc)Bit Manipulation.
  2075. * stdc_bit_width_ul: (libc)Bit Manipulation.
  2076. * stdc_bit_width_ull: (libc)Bit Manipulation.
  2077. * stdc_bit_width_us: (libc)Bit Manipulation.
  2078. * stdc_count_ones_uc: (libc)Bit Manipulation.
  2079. * stdc_count_ones_ui: (libc)Bit Manipulation.
  2080. * stdc_count_ones_ul: (libc)Bit Manipulation.
  2081. * stdc_count_ones_ull: (libc)Bit Manipulation.
  2082. * stdc_count_ones_us: (libc)Bit Manipulation.
  2083. * stdc_count_zeros_uc: (libc)Bit Manipulation.
  2084. * stdc_count_zeros_ui: (libc)Bit Manipulation.
  2085. * stdc_count_zeros_ul: (libc)Bit Manipulation.
  2086. * stdc_count_zeros_ull: (libc)Bit Manipulation.
  2087. * stdc_count_zeros_us: (libc)Bit Manipulation.
  2088. * stdc_first_leading_one_uc: (libc)Bit Manipulation.
  2089. * stdc_first_leading_one_ui: (libc)Bit Manipulation.
  2090. * stdc_first_leading_one_ul: (libc)Bit Manipulation.
  2091. * stdc_first_leading_one_ull: (libc)Bit Manipulation.
  2092. * stdc_first_leading_one_us: (libc)Bit Manipulation.
  2093. * stdc_first_leading_zero_uc: (libc)Bit Manipulation.
  2094. * stdc_first_leading_zero_ui: (libc)Bit Manipulation.
  2095. * stdc_first_leading_zero_ul: (libc)Bit Manipulation.
  2096. * stdc_first_leading_zero_ull: (libc)Bit Manipulation.
  2097. * stdc_first_leading_zero_us: (libc)Bit Manipulation.
  2098. * stdc_first_trailing_one_uc: (libc)Bit Manipulation.
  2099. * stdc_first_trailing_one_ui: (libc)Bit Manipulation.
  2100. * stdc_first_trailing_one_ul: (libc)Bit Manipulation.
  2101. * stdc_first_trailing_one_ull: (libc)Bit Manipulation.
  2102. * stdc_first_trailing_one_us: (libc)Bit Manipulation.
  2103. * stdc_first_trailing_zero_uc: (libc)Bit Manipulation.
  2104. * stdc_first_trailing_zero_ui: (libc)Bit Manipulation.
  2105. * stdc_first_trailing_zero_ul: (libc)Bit Manipulation.
  2106. * stdc_first_trailing_zero_ull: (libc)Bit Manipulation.
  2107. * stdc_first_trailing_zero_us: (libc)Bit Manipulation.
  2108. * stdc_has_single_bit_uc: (libc)Bit Manipulation.
  2109. * stdc_has_single_bit_ui: (libc)Bit Manipulation.
  2110. * stdc_has_single_bit_ul: (libc)Bit Manipulation.
  2111. * stdc_has_single_bit_ull: (libc)Bit Manipulation.
  2112. * stdc_has_single_bit_us: (libc)Bit Manipulation.
  2113. * stdc_leading_ones_uc: (libc)Bit Manipulation.
  2114. * stdc_leading_ones_ui: (libc)Bit Manipulation.
  2115. * stdc_leading_ones_ul: (libc)Bit Manipulation.
  2116. * stdc_leading_ones_ull: (libc)Bit Manipulation.
  2117. * stdc_leading_ones_us: (libc)Bit Manipulation.
  2118. * stdc_leading_zeros_uc: (libc)Bit Manipulation.
  2119. * stdc_leading_zeros_ui: (libc)Bit Manipulation.
  2120. * stdc_leading_zeros_ul: (libc)Bit Manipulation.
  2121. * stdc_leading_zeros_ull: (libc)Bit Manipulation.
  2122. * stdc_leading_zeros_us: (libc)Bit Manipulation.
  2123. * stdc_trailing_ones_uc: (libc)Bit Manipulation.
  2124. * stdc_trailing_ones_ui: (libc)Bit Manipulation.
  2125. * stdc_trailing_ones_ul: (libc)Bit Manipulation.
  2126. * stdc_trailing_ones_ull: (libc)Bit Manipulation.
  2127. * stdc_trailing_ones_us: (libc)Bit Manipulation.
  2128. * stdc_trailing_zeros_uc: (libc)Bit Manipulation.
  2129. * stdc_trailing_zeros_ui: (libc)Bit Manipulation.
  2130. * stdc_trailing_zeros_ul: (libc)Bit Manipulation.
  2131. * stdc_trailing_zeros_ull: (libc)Bit Manipulation.
  2132. * stdc_trailing_zeros_us: (libc)Bit Manipulation.
  2133. * stime: (libc)Setting and Adjusting the Time.
  2134. * stpcpy: (libc)Copying Strings and Arrays.
  2135. * stpncpy: (libc)Truncating Strings.
  2136. * strcasecmp: (libc)String/Array Comparison.
  2137. * strcasestr: (libc)Search Functions.
  2138. * strcat: (libc)Concatenating Strings.
  2139. * strchr: (libc)Search Functions.
  2140. * strchrnul: (libc)Search Functions.
  2141. * strcmp: (libc)String/Array Comparison.
  2142. * strcoll: (libc)Collation Functions.
  2143. * strcpy: (libc)Copying Strings and Arrays.
  2144. * strcspn: (libc)Search Functions.
  2145. * strdup: (libc)Copying Strings and Arrays.
  2146. * strdupa: (libc)Copying Strings and Arrays.
  2147. * strerror: (libc)Error Messages.
  2148. * strerror_l: (libc)Error Messages.
  2149. * strerror_r: (libc)Error Messages.
  2150. * strerror_r: (libc)Error Messages.
  2151. * strerrordesc_np: (libc)Error Messages.
  2152. * strerrorname_np: (libc)Error Messages.
  2153. * strfmon: (libc)Formatting Numbers.
  2154. * strfromd: (libc)Printing of Floats.
  2155. * strfromf: (libc)Printing of Floats.
  2156. * strfromfN: (libc)Printing of Floats.
  2157. * strfromfNx: (libc)Printing of Floats.
  2158. * strfroml: (libc)Printing of Floats.
  2159. * strfry: (libc)Shuffling Bytes.
  2160. * strftime: (libc)Formatting Calendar Time.
  2161. * strftime_l: (libc)Formatting Calendar Time.
  2162. * strlcat: (libc)Truncating Strings.
  2163. * strlcpy: (libc)Truncating Strings.
  2164. * strlen: (libc)String Length.
  2165. * strncasecmp: (libc)String/Array Comparison.
  2166. * strncat: (libc)Truncating Strings.
  2167. * strncmp: (libc)String/Array Comparison.
  2168. * strncpy: (libc)Truncating Strings.
  2169. * strndup: (libc)Truncating Strings.
  2170. * strndupa: (libc)Truncating Strings.
  2171. * strnlen: (libc)String Length.
  2172. * strpbrk: (libc)Search Functions.
  2173. * strptime: (libc)Low-Level Time String Parsing.
  2174. * strrchr: (libc)Search Functions.
  2175. * strsep: (libc)Finding Tokens in a String.
  2176. * strsignal: (libc)Signal Messages.
  2177. * strspn: (libc)Search Functions.
  2178. * strstr: (libc)Search Functions.
  2179. * strtod: (libc)Parsing of Floats.
  2180. * strtof: (libc)Parsing of Floats.
  2181. * strtofN: (libc)Parsing of Floats.
  2182. * strtofNx: (libc)Parsing of Floats.
  2183. * strtoimax: (libc)Parsing of Integers.
  2184. * strtok: (libc)Finding Tokens in a String.
  2185. * strtok_r: (libc)Finding Tokens in a String.
  2186. * strtol: (libc)Parsing of Integers.
  2187. * strtold: (libc)Parsing of Floats.
  2188. * strtoll: (libc)Parsing of Integers.
  2189. * strtoq: (libc)Parsing of Integers.
  2190. * strtoul: (libc)Parsing of Integers.
  2191. * strtoull: (libc)Parsing of Integers.
  2192. * strtoumax: (libc)Parsing of Integers.
  2193. * strtouq: (libc)Parsing of Integers.
  2194. * strverscmp: (libc)String/Array Comparison.
  2195. * strxfrm: (libc)Collation Functions.
  2196. * stty: (libc)BSD Terminal Modes.
  2197. * swapcontext: (libc)System V contexts.
  2198. * swprintf: (libc)Formatted Output Functions.
  2199. * swscanf: (libc)Formatted Input Functions.
  2200. * symlink: (libc)Symbolic Links.
  2201. * sync: (libc)Synchronizing I/O.
  2202. * syscall: (libc)System Calls.
  2203. * sysconf: (libc)Sysconf Definition.
  2204. * syslog: (libc)syslog; vsyslog.
  2205. * system: (libc)Running a Command.
  2206. * sysv_signal: (libc)Basic Signal Handling.
  2207. * tan: (libc)Trig Functions.
  2208. * tanf: (libc)Trig Functions.
  2209. * tanfN: (libc)Trig Functions.
  2210. * tanfNx: (libc)Trig Functions.
  2211. * tanh: (libc)Hyperbolic Functions.
  2212. * tanhf: (libc)Hyperbolic Functions.
  2213. * tanhfN: (libc)Hyperbolic Functions.
  2214. * tanhfNx: (libc)Hyperbolic Functions.
  2215. * tanhl: (libc)Hyperbolic Functions.
  2216. * tanl: (libc)Trig Functions.
  2217. * tanpi: (libc)Trig Functions.
  2218. * tanpif: (libc)Trig Functions.
  2219. * tanpifN: (libc)Trig Functions.
  2220. * tanpifNx: (libc)Trig Functions.
  2221. * tanpil: (libc)Trig Functions.
  2222. * tcdrain: (libc)Line Control.
  2223. * tcflow: (libc)Line Control.
  2224. * tcflush: (libc)Line Control.
  2225. * tcgetattr: (libc)Mode Functions.
  2226. * tcgetpgrp: (libc)Terminal Access Functions.
  2227. * tcgetsid: (libc)Terminal Access Functions.
  2228. * tcsendbreak: (libc)Line Control.
  2229. * tcsetattr: (libc)Mode Functions.
  2230. * tcsetpgrp: (libc)Terminal Access Functions.
  2231. * tdelete: (libc)Tree Search Function.
  2232. * tdestroy: (libc)Tree Search Function.
  2233. * telldir: (libc)Random Access Directory.
  2234. * tempnam: (libc)Temporary Files.
  2235. * textdomain: (libc)Locating gettext catalog.
  2236. * tfind: (libc)Tree Search Function.
  2237. * tgamma: (libc)Special Functions.
  2238. * tgammaf: (libc)Special Functions.
  2239. * tgammafN: (libc)Special Functions.
  2240. * tgammafNx: (libc)Special Functions.
  2241. * tgammal: (libc)Special Functions.
  2242. * tgkill: (libc)Signaling Another Process.
  2243. * thrd_create: (libc)ISO C Thread Management.
  2244. * thrd_current: (libc)ISO C Thread Management.
  2245. * thrd_detach: (libc)ISO C Thread Management.
  2246. * thrd_equal: (libc)ISO C Thread Management.
  2247. * thrd_exit: (libc)ISO C Thread Management.
  2248. * thrd_join: (libc)ISO C Thread Management.
  2249. * thrd_sleep: (libc)ISO C Thread Management.
  2250. * thrd_yield: (libc)ISO C Thread Management.
  2251. * time: (libc)Getting the Time.
  2252. * timegm: (libc)Broken-down Time.
  2253. * timelocal: (libc)Broken-down Time.
  2254. * times: (libc)Processor Time.
  2255. * timespec_get: (libc)Getting the Time.
  2256. * timespec_getres: (libc)Getting the Time.
  2257. * tmpfile64: (libc)Temporary Files.
  2258. * tmpfile: (libc)Temporary Files.
  2259. * tmpnam: (libc)Temporary Files.
  2260. * tmpnam_r: (libc)Temporary Files.
  2261. * toascii: (libc)Case Conversion.
  2262. * tolower: (libc)Case Conversion.
  2263. * totalorder: (libc)FP Comparison Functions.
  2264. * totalorderf: (libc)FP Comparison Functions.
  2265. * totalorderfN: (libc)FP Comparison Functions.
  2266. * totalorderfNx: (libc)FP Comparison Functions.
  2267. * totalorderl: (libc)FP Comparison Functions.
  2268. * totalordermag: (libc)FP Comparison Functions.
  2269. * totalordermagf: (libc)FP Comparison Functions.
  2270. * totalordermagfN: (libc)FP Comparison Functions.
  2271. * totalordermagfNx: (libc)FP Comparison Functions.
  2272. * totalordermagl: (libc)FP Comparison Functions.
  2273. * toupper: (libc)Case Conversion.
  2274. * towctrans: (libc)Wide Character Case Conversion.
  2275. * towlower: (libc)Wide Character Case Conversion.
  2276. * towupper: (libc)Wide Character Case Conversion.
  2277. * trunc: (libc)Rounding Functions.
  2278. * truncate64: (libc)File Size.
  2279. * truncate: (libc)File Size.
  2280. * truncf: (libc)Rounding Functions.
  2281. * truncfN: (libc)Rounding Functions.
  2282. * truncfNx: (libc)Rounding Functions.
  2283. * truncl: (libc)Rounding Functions.
  2284. * tsearch: (libc)Tree Search Function.
  2285. * tss_create: (libc)ISO C Thread-local Storage.
  2286. * tss_delete: (libc)ISO C Thread-local Storage.
  2287. * tss_get: (libc)ISO C Thread-local Storage.
  2288. * tss_set: (libc)ISO C Thread-local Storage.
  2289. * ttyname: (libc)Is It a Terminal.
  2290. * ttyname_r: (libc)Is It a Terminal.
  2291. * twalk: (libc)Tree Search Function.
  2292. * twalk_r: (libc)Tree Search Function.
  2293. * tzset: (libc)Time Zone State.
  2294. * uabs: (libc)Absolute Value.
  2295. * ufromfp: (libc)Rounding Functions.
  2296. * ufromfpf: (libc)Rounding Functions.
  2297. * ufromfpfN: (libc)Rounding Functions.
  2298. * ufromfpfNx: (libc)Rounding Functions.
  2299. * ufromfpl: (libc)Rounding Functions.
  2300. * ufromfpx: (libc)Rounding Functions.
  2301. * ufromfpxf: (libc)Rounding Functions.
  2302. * ufromfpxfN: (libc)Rounding Functions.
  2303. * ufromfpxfNx: (libc)Rounding Functions.
  2304. * ufromfpxl: (libc)Rounding Functions.
  2305. * ulabs: (libc)Absolute Value.
  2306. * ulimit: (libc)Limits on Resources.
  2307. * ullabs: (libc)Absolute Value.
  2308. * umask: (libc)Setting Permissions.
  2309. * umaxabs: (libc)Absolute Value.
  2310. * umount2: (libc)Mount-Unmount-Remount.
  2311. * umount: (libc)Mount-Unmount-Remount.
  2312. * uname: (libc)Platform Type.
  2313. * ungetc: (libc)How Unread.
  2314. * ungetwc: (libc)How Unread.
  2315. * unlink: (libc)Deleting Files.
  2316. * unlinkat: (libc)Deleting Files.
  2317. * unlockpt: (libc)Allocation.
  2318. * unsetenv: (libc)Environment Access.
  2319. * updwtmp: (libc)Manipulating the Database.
  2320. * utime: (libc)File Times.
  2321. * utimensat: (libc)File Times.
  2322. * utimes: (libc)File Times.
  2323. * utmpname: (libc)Manipulating the Database.
  2324. * utmpxname: (libc)XPG Functions.
  2325. * va_arg: (libc)Argument Macros.
  2326. * va_copy: (libc)Argument Macros.
  2327. * va_end: (libc)Argument Macros.
  2328. * va_start: (libc)Argument Macros.
  2329. * valloc: (libc)Aligned Memory Blocks.
  2330. * vasprintf: (libc)Variable Arguments Output.
  2331. * vdprintf: (libc)Variable Arguments Output.
  2332. * verr: (libc)Error Messages.
  2333. * verrx: (libc)Error Messages.
  2334. * versionsort64: (libc)Scanning Directory Content.
  2335. * versionsort: (libc)Scanning Directory Content.
  2336. * vfork: (libc)Creating a Process.
  2337. * vfprintf: (libc)Variable Arguments Output.
  2338. * vfscanf: (libc)Variable Arguments Input.
  2339. * vfwprintf: (libc)Variable Arguments Output.
  2340. * vfwscanf: (libc)Variable Arguments Input.
  2341. * vlimit: (libc)Limits on Resources.
  2342. * vprintf: (libc)Variable Arguments Output.
  2343. * vscanf: (libc)Variable Arguments Input.
  2344. * vsnprintf: (libc)Variable Arguments Output.
  2345. * vsprintf: (libc)Variable Arguments Output.
  2346. * vsscanf: (libc)Variable Arguments Input.
  2347. * vswprintf: (libc)Variable Arguments Output.
  2348. * vswscanf: (libc)Variable Arguments Input.
  2349. * vsyslog: (libc)syslog; vsyslog.
  2350. * vwarn: (libc)Error Messages.
  2351. * vwarnx: (libc)Error Messages.
  2352. * vwprintf: (libc)Variable Arguments Output.
  2353. * vwscanf: (libc)Variable Arguments Input.
  2354. * wait3: (libc)BSD Wait Functions.
  2355. * wait4: (libc)Process Completion.
  2356. * wait: (libc)Process Completion.
  2357. * waitpid: (libc)Process Completion.
  2358. * warn: (libc)Error Messages.
  2359. * warnx: (libc)Error Messages.
  2360. * wcpcpy: (libc)Copying Strings and Arrays.
  2361. * wcpncpy: (libc)Truncating Strings.
  2362. * wcrtomb: (libc)Converting a Character.
  2363. * wcscasecmp: (libc)String/Array Comparison.
  2364. * wcscat: (libc)Concatenating Strings.
  2365. * wcschr: (libc)Search Functions.
  2366. * wcschrnul: (libc)Search Functions.
  2367. * wcscmp: (libc)String/Array Comparison.
  2368. * wcscoll: (libc)Collation Functions.
  2369. * wcscpy: (libc)Copying Strings and Arrays.
  2370. * wcscspn: (libc)Search Functions.
  2371. * wcsdup: (libc)Copying Strings and Arrays.
  2372. * wcsftime: (libc)Formatting Calendar Time.
  2373. * wcslcat: (libc)Truncating Strings.
  2374. * wcslcpy: (libc)Truncating Strings.
  2375. * wcslen: (libc)String Length.
  2376. * wcsncasecmp: (libc)String/Array Comparison.
  2377. * wcsncat: (libc)Truncating Strings.
  2378. * wcsncmp: (libc)String/Array Comparison.
  2379. * wcsncpy: (libc)Truncating Strings.
  2380. * wcsnlen: (libc)String Length.
  2381. * wcsnrtombs: (libc)Converting Strings.
  2382. * wcspbrk: (libc)Search Functions.
  2383. * wcsrchr: (libc)Search Functions.
  2384. * wcsrtombs: (libc)Converting Strings.
  2385. * wcsspn: (libc)Search Functions.
  2386. * wcsstr: (libc)Search Functions.
  2387. * wcstod: (libc)Parsing of Floats.
  2388. * wcstof: (libc)Parsing of Floats.
  2389. * wcstofN: (libc)Parsing of Floats.
  2390. * wcstofNx: (libc)Parsing of Floats.
  2391. * wcstoimax: (libc)Parsing of Integers.
  2392. * wcstok: (libc)Finding Tokens in a String.
  2393. * wcstol: (libc)Parsing of Integers.
  2394. * wcstold: (libc)Parsing of Floats.
  2395. * wcstoll: (libc)Parsing of Integers.
  2396. * wcstombs: (libc)Non-reentrant String Conversion.
  2397. * wcstoq: (libc)Parsing of Integers.
  2398. * wcstoul: (libc)Parsing of Integers.
  2399. * wcstoull: (libc)Parsing of Integers.
  2400. * wcstoumax: (libc)Parsing of Integers.
  2401. * wcstouq: (libc)Parsing of Integers.
  2402. * wcswcs: (libc)Search Functions.
  2403. * wcsxfrm: (libc)Collation Functions.
  2404. * wctob: (libc)Converting a Character.
  2405. * wctomb: (libc)Non-reentrant Character Conversion.
  2406. * wctrans: (libc)Wide Character Case Conversion.
  2407. * wctype: (libc)Classification of Wide Characters.
  2408. * wmemchr: (libc)Search Functions.
  2409. * wmemcmp: (libc)String/Array Comparison.
  2410. * wmemcpy: (libc)Copying Strings and Arrays.
  2411. * wmemmove: (libc)Copying Strings and Arrays.
  2412. * wmempcpy: (libc)Copying Strings and Arrays.
  2413. * wmemset: (libc)Copying Strings and Arrays.
  2414. * wordexp: (libc)Calling Wordexp.
  2415. * wordfree: (libc)Calling Wordexp.
  2416. * wprintf: (libc)Formatted Output Functions.
  2417. * write: (libc)I/O Primitives.
  2418. * writev: (libc)Scatter-Gather.
  2419. * wscanf: (libc)Formatted Input Functions.
  2420. * y0: (libc)Special Functions.
  2421. * y0f: (libc)Special Functions.
  2422. * y0fN: (libc)Special Functions.
  2423. * y0fNx: (libc)Special Functions.
  2424. * y0l: (libc)Special Functions.
  2425. * y1: (libc)Special Functions.
  2426. * y1f: (libc)Special Functions.
  2427. * y1fN: (libc)Special Functions.
  2428. * y1fNx: (libc)Special Functions.
  2429. * y1l: (libc)Special Functions.
  2430. * yn: (libc)Special Functions.
  2431. * ynf: (libc)Special Functions.
  2432. * ynfN: (libc)Special Functions.
  2433. * ynfNx: (libc)Special Functions.
  2434. * ynl: (libc)Special Functions.
  2435. END-INFO-DIR-ENTRY
  2436. 
  2437. File: libc.info, Node: Locales, Next: Message Translation, Prev: Character Set Handling, Up: Top
  2438. 7 Locales and Internationalization
  2439. **********************************
  2440. Different countries and cultures have varying conventions for how to
  2441. communicate. These conventions range from very simple ones, such as the
  2442. format for representing dates and times, to very complex ones, such as
  2443. the language spoken.
  2444. “Internationalization” of software means programming it to be able to
  2445. adapt to the user's favorite conventions. In ISO C,
  2446. internationalization works by means of “locales”. Each locale specifies
  2447. a collection of conventions, one convention for each purpose. The user
  2448. chooses a set of conventions by specifying a locale (via environment
  2449. variables).
  2450. All programs inherit the chosen locale as part of their environment.
  2451. Provided the programs are written to obey the choice of locale, they
  2452. will follow the conventions preferred by the user.
  2453. * Menu:
  2454. * Effects of Locale:: Actions affected by the choice of
  2455. locale.
  2456. * Choosing Locale:: How the user specifies a locale.
  2457. * Locale Categories:: Different purposes for which you can
  2458. select a locale.
  2459. * Setting the Locale:: How a program specifies the locale
  2460. with library functions.
  2461. * Standard Locales:: Locale names available on all systems.
  2462. * Locale Names:: Format of system-specific locale names.
  2463. * Locale Information:: How to access the information for the locale.
  2464. * Formatting Numbers:: A dedicated function to format numbers.
  2465. * Yes-or-No Questions:: Check a Response against the locale.
  2466. 
  2467. File: libc.info, Node: Effects of Locale, Next: Choosing Locale, Up: Locales
  2468. 7.1 What Effects a Locale Has
  2469. =============================
  2470. Each locale specifies conventions for several purposes, including the
  2471. following:
  2472. • What multibyte character sequences are valid, and how they are
  2473. interpreted (*note Character Set Handling::).
  2474. • Classification of which characters in the local character set are
  2475. considered alphabetic, and upper- and lower-case conversion
  2476. conventions (*note Character Handling::).
  2477. • The collating sequence for the local language and character set
  2478. (*note Collation Functions::).
  2479. • Formatting of numbers and currency amounts (*note General
  2480. Numeric::).
  2481. • Formatting of dates and times (*note Formatting Calendar Time::).
  2482. • What language to use for output, including error messages (*note
  2483. Message Translation::).
  2484. • What language to use for user answers to yes-or-no questions (*note
  2485. Yes-or-No Questions::).
  2486. • What language to use for more complex user input. (The C library
  2487. doesn't yet help you implement this.)
  2488. Some aspects of adapting to the specified locale are handled
  2489. automatically by the library subroutines. For example, all your program
  2490. needs to do in order to use the collating sequence of the chosen locale
  2491. is to use ‘strcoll’ or ‘strxfrm’ to compare strings.
  2492. Other aspects of locales are beyond the comprehension of the library.
  2493. For example, the library can't automatically translate your program's
  2494. output messages into other languages. The only way you can support
  2495. output in the user's favorite language is to program this more or less
  2496. by hand. The C library provides functions to handle translations for
  2497. multiple languages easily.
  2498. This chapter discusses the mechanism by which you can modify the
  2499. current locale. The effects of the current locale on specific library
  2500. functions are discussed in more detail in the descriptions of those
  2501. functions.
  2502. 
  2503. File: libc.info, Node: Choosing Locale, Next: Locale Categories, Prev: Effects of Locale, Up: Locales
  2504. 7.2 Choosing a Locale
  2505. =====================
  2506. The simplest way for the user to choose a locale is to set the
  2507. environment variable ‘LANG’. This specifies a single locale to use for
  2508. all purposes. For example, a user could specify a hypothetical locale
  2509. named ‘espana-castellano’ to use the standard conventions of most of
  2510. Spain.
  2511. The set of locales supported depends on the operating system you are
  2512. using, and so do their names, except that the standard locale called ‘C’
  2513. or ‘POSIX’ always exist. *Note Locale Names::.
  2514. In order to force the system to always use the default locale, the
  2515. user can set the ‘LC_ALL’ environment variable to ‘C’.
  2516. A user also has the option of specifying different locales for
  2517. different purposes--in effect, choosing a mixture of multiple locales.
  2518. *Note Locale Categories::.
  2519. For example, the user might specify the locale ‘espana-castellano’
  2520. for most purposes, but specify the locale ‘usa-english’ for currency
  2521. formatting. This might make sense if the user is a Spanish-speaking
  2522. American, working in Spanish, but representing monetary amounts in US
  2523. dollars.
  2524. Note that both locales ‘espana-castellano’ and ‘usa-english’, like
  2525. all locales, would include conventions for all of the purposes to which
  2526. locales apply. However, the user can choose to use each locale for a
  2527. particular subset of those purposes.
  2528. 
  2529. File: libc.info, Node: Locale Categories, Next: Setting the Locale, Prev: Choosing Locale, Up: Locales
  2530. 7.3 Locale Categories
  2531. =====================
  2532. The purposes that locales serve are grouped into “categories”, so that a
  2533. user or a program can choose the locale for each category independently.
  2534. Here is a table of categories; each name is both an environment variable
  2535. that a user can set, and a macro name that you can use as the first
  2536. argument to ‘setlocale’.
  2537. The contents of the environment variable (or the string in the second
  2538. argument to ‘setlocale’) has to be a valid locale name. *Note Locale
  2539. Names::.
  2540. ‘LC_COLLATE’
  2541. This category applies to collation of strings (functions ‘strcoll’
  2542. and ‘strxfrm’); see *note Collation Functions::.
  2543. ‘LC_CTYPE’
  2544. This category applies to classification and conversion of
  2545. characters, and to multibyte and wide characters; see *note
  2546. Character Handling::, and *note Character Set Handling::.
  2547. ‘LC_MONETARY’
  2548. This category applies to formatting monetary values; see *note
  2549. General Numeric::.
  2550. ‘LC_NUMERIC’
  2551. This category applies to formatting numeric values that are not
  2552. monetary; see *note General Numeric::.
  2553. ‘LC_TIME’
  2554. This category applies to formatting date and time values; see *note
  2555. Formatting Calendar Time::.
  2556. ‘LC_MESSAGES’
  2557. This category applies to selecting the language used in the user
  2558. interface for message translation (*note The Uniforum approach::;
  2559. *note Message catalogs a la X/Open::) and contains regular
  2560. expressions for affirmative and negative responses.
  2561. ‘LC_ALL’
  2562. This is not a category; it is only a macro that you can use with
  2563. ‘setlocale’ to set a single locale for all purposes. Setting this
  2564. environment variable overwrites all selections by the other ‘LC_*’
  2565. variables or ‘LANG’.
  2566. ‘LANG’
  2567. If this environment variable is defined, its value specifies the
  2568. locale to use for all purposes except as overridden by the
  2569. variables above.
  2570. When developing the message translation functions it was felt that
  2571. the functionality provided by the variables above is not sufficient.
  2572. For example, it should be possible to specify more than one locale name.
  2573. Take a Swedish user who better speaks German than English, and a program
  2574. whose messages are output in English by default. It should be possible
  2575. to specify that the first choice of language is Swedish, the second
  2576. German, and if this also fails to use English. This is possible with
  2577. the variable ‘LANGUAGE’. For further description of this GNU extension
  2578. see *note Using gettextized software::.
  2579. 
  2580. File: libc.info, Node: Setting the Locale, Next: Standard Locales, Prev: Locale Categories, Up: Locales
  2581. 7.4 How Programs Set the Locale
  2582. ===============================
  2583. A C program inherits its locale environment variables when it starts up.
  2584. This happens automatically. However, these variables do not
  2585. automatically control the locale used by the library functions, because
  2586. ISO C says that all programs start by default in the standard ‘C’
  2587. locale. To use the locales specified by the environment, you must call
  2588. ‘setlocale’. Call it as follows:
  2589. setlocale (LC_ALL, "");
  2590. to select a locale based on the user choice of the appropriate
  2591. environment variables.
  2592. You can also use ‘setlocale’ to specify a particular locale, for
  2593. general use or for a specific category.
  2594. The symbols in this section are defined in the header file
  2595. ‘locale.h’.
  2596. -- Function: char * setlocale (int CATEGORY, const char *LOCALE)
  2597. Preliminary: | MT-Unsafe const:locale env | AS-Unsafe init lock
  2598. heap corrupt | AC-Unsafe init corrupt lock mem fd | *Note POSIX
  2599. Safety Concepts::.
  2600. The function ‘setlocale’ sets the current locale for category
  2601. CATEGORY to LOCALE.
  2602. If CATEGORY is ‘LC_ALL’, this specifies the locale for all
  2603. purposes. The other possible values of CATEGORY specify a single
  2604. purpose (*note Locale Categories::).
  2605. You can also use this function to find out the current locale by
  2606. passing a null pointer as the LOCALE argument. In this case,
  2607. ‘setlocale’ returns a string that is the name of the locale
  2608. currently selected for category CATEGORY.
  2609. The string returned by ‘setlocale’ can be overwritten by subsequent
  2610. calls, so you should make a copy of the string (*note Copying
  2611. Strings and Arrays::) if you want to save it past any further calls
  2612. to ‘setlocale’. (The standard library is guaranteed never to call
  2613. ‘setlocale’ itself.)
  2614. You should not modify the string returned by ‘setlocale’. It might
  2615. be the same string that was passed as an argument in a previous
  2616. call to ‘setlocale’. One requirement is that the CATEGORY must be
  2617. the same in the call the string was returned and the one when the
  2618. string is passed in as LOCALE parameter.
  2619. When you read the current locale for category ‘LC_ALL’, the value
  2620. encodes the entire combination of selected locales for all
  2621. categories. If you specify the same "locale name" with ‘LC_ALL’ in
  2622. a subsequent call to ‘setlocale’, it restores the same combination
  2623. of locale selections.
  2624. To be sure you can use the returned string encoding the currently
  2625. selected locale at a later time, you must make a copy of the
  2626. string. It is not guaranteed that the returned pointer remains
  2627. valid over time.
  2628. When the LOCALE argument is not a null pointer, the string returned
  2629. by ‘setlocale’ reflects the newly-modified locale.
  2630. If you specify an empty string for LOCALE, this means to read the
  2631. appropriate environment variable and use its value to select the
  2632. locale for CATEGORY.
  2633. If a nonempty string is given for LOCALE, then the locale of that
  2634. name is used if possible.
  2635. The effective locale name (either the second argument to
  2636. ‘setlocale’, or if the argument is an empty string, the name
  2637. obtained from the process environment) must be a valid locale name.
  2638. *Note Locale Names::.
  2639. If you specify an invalid locale name, ‘setlocale’ returns a null
  2640. pointer and leaves the current locale unchanged.
  2641. Here is an example showing how you might use ‘setlocale’ to
  2642. temporarily switch to a new locale.
  2643. #include <stddef.h>
  2644. #include <locale.h>
  2645. #include <stdlib.h>
  2646. #include <string.h>
  2647. void
  2648. with_other_locale (char *new_locale,
  2649. void (*subroutine) (int),
  2650. int argument)
  2651. {
  2652. char *old_locale, *saved_locale;
  2653. /* Get the name of the current locale. */
  2654. old_locale = setlocale (LC_ALL, NULL);
  2655. /* Copy the name so it won't be clobbered by ‘setlocale’. */
  2656. saved_locale = strdup (old_locale);
  2657. if (saved_locale == NULL)
  2658. fatal ("Out of memory");
  2659. /* Now change the locale and do some stuff with it. */
  2660. setlocale (LC_ALL, new_locale);
  2661. (*subroutine) (argument);
  2662. /* Restore the original locale. */
  2663. setlocale (LC_ALL, saved_locale);
  2664. free (saved_locale);
  2665. }
  2666. *Portability Note:* Some ISO C systems may define additional locale
  2667. categories, and future versions of the library will do so. For
  2668. portability, assume that any symbol beginning with ‘LC_’ might be
  2669. defined in ‘locale.h’.
  2670. 
  2671. File: libc.info, Node: Standard Locales, Next: Locale Names, Prev: Setting the Locale, Up: Locales
  2672. 7.5 Standard Locales
  2673. ====================
  2674. The only locale names you can count on finding on all operating systems
  2675. are these three standard ones:
  2676. ‘"C"’
  2677. This is the standard C locale. The attributes and behavior it
  2678. provides are specified in the ISO C standard. When your program
  2679. starts up, it initially uses this locale by default.
  2680. ‘"POSIX"’
  2681. This is the standard POSIX locale. Currently, it is an alias for
  2682. the standard C locale.
  2683. ‘""’
  2684. The empty name says to select a locale based on environment
  2685. variables. *Note Locale Categories::.
  2686. Defining and installing named locales is normally a responsibility of
  2687. the system administrator at your site (or the person who installed the
  2688. GNU C Library). It is also possible for the user to create private
  2689. locales. All this will be discussed later when describing the tool to
  2690. do so.
  2691. If your program needs to use something other than the ‘C’ locale, it
  2692. will be more portable if you use whatever locale the user specifies with
  2693. the environment, rather than trying to specify some non-standard locale
  2694. explicitly by name. Remember, different machines might have different
  2695. sets of locales installed.
  2696. 
  2697. File: libc.info, Node: Locale Names, Next: Locale Information, Prev: Standard Locales, Up: Locales
  2698. 7.6 Locale Names
  2699. ================
  2700. The following command prints a list of locales supported by the system:
  2701. locale -a
  2702. *Portability Note:* With the notable exception of the standard locale
  2703. names ‘C’ and ‘POSIX’, locale names are system-specific.
  2704. Most locale names follow XPG syntax and consist of up to four parts:
  2705. LANGUAGE[_TERRITORY[.CODESET]][@MODIFIER]
  2706. Beside the first part, all of them are allowed to be missing. If the
  2707. full specified locale is not found, less specific ones are looked for.
  2708. The various parts will be stripped off, in the following order:
  2709. 1. codeset
  2710. 2. normalized codeset
  2711. 3. territory
  2712. 4. modifier
  2713. For example, the locale name ‘de_AT.iso885915@euro’ denotes a
  2714. German-language locale for use in Austria, using the ISO-8859-15
  2715. (Latin-9) character set, and with the Euro as the currency symbol.
  2716. In addition to locale names which follow XPG syntax, systems may
  2717. provide aliases such as ‘german’. Both categories of names must not
  2718. contain the slash character ‘/’.
  2719. If the locale name starts with a slash ‘/’, it is treated as a path
  2720. relative to the configured locale directories; see ‘LOCPATH’ below. The
  2721. specified path must not contain a component ‘..’, or the name is
  2722. invalid, and ‘setlocale’ will fail.
  2723. *Portability Note:* POSIX suggests that if a locale name starts with
  2724. a slash ‘/’, it is resolved as an absolute path. However, the GNU C
  2725. Library treats it as a relative path under the directories listed in
  2726. ‘LOCPATH’ (or the default locale directory if ‘LOCPATH’ is unset).
  2727. Locale names which are longer than an implementation-defined limit
  2728. are invalid and cause ‘setlocale’ to fail.
  2729. As a special case, locale names used with ‘LC_ALL’ can combine
  2730. several locales, reflecting different locale settings for different
  2731. categories. For example, you might want to use a U.S. locale with ISO
  2732. A4 paper format, so you set ‘LANG’ to ‘en_US.UTF-8’, and ‘LC_PAPER’ to
  2733. ‘de_DE.UTF-8’. In this case, the ‘LC_ALL’-style combined locale name is
  2734. LC_CTYPE=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_PAPER=de_DE.UTF-8;...
  2735. followed by other category settings not shown here.
  2736. The path used for finding locale data can be set using the ‘LOCPATH’
  2737. environment variable. This variable lists the directories in which to
  2738. search for locale definitions, separated by a colon ‘:’.
  2739. The default path for finding locale data is system specific. A
  2740. typical value for the ‘LOCPATH’ default is:
  2741. /usr/share/locale
  2742. The value of ‘LOCPATH’ is ignored by privileged programs for security
  2743. reasons, and only the default directory is used.
  2744. 
  2745. File: libc.info, Node: Locale Information, Next: Formatting Numbers, Prev: Locale Names, Up: Locales
  2746. 7.7 Accessing Locale Information
  2747. ================================
  2748. There are several ways to access locale information. The simplest way
  2749. is to let the C library itself do the work. Several of the functions in
  2750. this library implicitly access the locale data, and use what information
  2751. is provided by the currently selected locale. This is how the locale
  2752. model is meant to work normally.
  2753. As an example take the ‘strftime’ function, which is meant to nicely
  2754. format date and time information (*note Formatting Calendar Time::).
  2755. Part of the standard information contained in the ‘LC_TIME’ category is
  2756. the names of the months. Instead of requiring the programmer to take
  2757. care of providing the translations the ‘strftime’ function does this all
  2758. by itself. ‘%A’ in the format string is replaced by the appropriate
  2759. weekday name of the locale currently selected by ‘LC_TIME’. This is an
  2760. easy example, and wherever possible functions do things automatically in
  2761. this way.
  2762. But there are quite often situations when there is simply no function
  2763. to perform the task, or it is simply not possible to do the work
  2764. automatically. For these cases it is necessary to access the
  2765. information in the locale directly. To do this the C library provides
  2766. two functions: ‘localeconv’ and ‘nl_langinfo’. The former is part of
  2767. ISO C and therefore portable, but has a brain-damaged interface. The
  2768. second is part of the Unix interface and is portable in as far as the
  2769. system follows the Unix standards.
  2770. * Menu:
  2771. * The Lame Way to Locale Data:: ISO C's ‘localeconv’.
  2772. * The Elegant and Fast Way:: X/Open's ‘nl_langinfo’.
  2773. 
  2774. File: libc.info, Node: The Lame Way to Locale Data, Next: The Elegant and Fast Way, Up: Locale Information
  2775. 7.7.1 ‘localeconv’: It is portable but ...
  2776. ------------------------------------------
  2777. Together with the ‘setlocale’ function the ISO C people invented the
  2778. ‘localeconv’ function. It is a masterpiece of poor design. It is
  2779. expensive to use, not extensible, and not generally usable as it
  2780. provides access to only ‘LC_MONETARY’ and ‘LC_NUMERIC’ related
  2781. information. Nevertheless, if it is applicable to a given situation it
  2782. should be used since it is very portable. The function ‘strfmon’
  2783. formats monetary amounts according to the selected locale using this
  2784. information.
  2785. -- Function: struct lconv * localeconv (void)
  2786. Preliminary: | MT-Unsafe race:localeconv locale | AS-Unsafe |
  2787. AC-Safe | *Note POSIX Safety Concepts::.
  2788. The ‘localeconv’ function returns a pointer to a structure whose
  2789. components contain information about how numeric and monetary
  2790. values should be formatted in the current locale.
  2791. You should not modify the structure or its contents. The structure
  2792. might be overwritten by subsequent calls to ‘localeconv’, or by
  2793. calls to ‘setlocale’, but no other function in the library
  2794. overwrites this value.
  2795. -- Data Type: struct lconv
  2796. ‘localeconv’'s return value is of this data type. Its elements are
  2797. described in the following subsections.
  2798. If a member of the structure ‘struct lconv’ has type ‘char’, and the
  2799. value is ‘CHAR_MAX’, it means that the current locale has no value for
  2800. that parameter.
  2801. * Menu:
  2802. * General Numeric:: Parameters for formatting numbers and
  2803. currency amounts.
  2804. * Currency Symbol:: How to print the symbol that identifies an
  2805. amount of money (e.g. ‘$’).
  2806. * Sign of Money Amount:: How to print the (positive or negative) sign
  2807. for a monetary amount, if one exists.
  2808. 
  2809. File: libc.info, Node: General Numeric, Next: Currency Symbol, Up: The Lame Way to Locale Data
  2810. 7.7.1.1 Generic Numeric Formatting Parameters
  2811. .............................................
  2812. These are the standard members of ‘struct lconv’; there may be others.
  2813. ‘char *decimal_point’
  2814. ‘char *mon_decimal_point’
  2815. These are the decimal-point separators used in formatting
  2816. non-monetary and monetary quantities, respectively. In the ‘C’
  2817. locale, the value of ‘decimal_point’ is ‘"."’, and the value of
  2818. ‘mon_decimal_point’ is ‘""’.
  2819. ‘char *thousands_sep’
  2820. ‘char *mon_thousands_sep’
  2821. These are the separators used to delimit groups of digits to the
  2822. left of the decimal point in formatting non-monetary and monetary
  2823. quantities, respectively. In the ‘C’ locale, both members have a
  2824. value of ‘""’ (the empty string).
  2825. ‘char *grouping’
  2826. ‘char *mon_grouping’
  2827. These are strings that specify how to group the digits to the left
  2828. of the decimal point. ‘grouping’ applies to non-monetary
  2829. quantities and ‘mon_grouping’ applies to monetary quantities. Use
  2830. either ‘thousands_sep’ or ‘mon_thousands_sep’ to separate the digit
  2831. groups.
  2832. Each member of these strings is to be interpreted as an integer
  2833. value of type ‘char’. Successive numbers (from left to right) give
  2834. the sizes of successive groups (from right to left, starting at the
  2835. decimal point.) The last member is either ‘0’, in which case the
  2836. previous member is used over and over again for all the remaining
  2837. groups, or ‘CHAR_MAX’, in which case there is no more grouping--or,
  2838. put another way, any remaining digits form one large group without
  2839. separators.
  2840. For example, if ‘grouping’ is ‘"\04\03\02"’, the correct grouping
  2841. for the number ‘123456787654321’ is ‘12’, ‘34’, ‘56’, ‘78’, ‘765’,
  2842. ‘4321’. This uses a group of 4 digits at the end, preceded by a
  2843. group of 3 digits, preceded by groups of 2 digits (as many as
  2844. needed). With a separator of ‘,’, the number would be printed as
  2845. ‘12,34,56,78,765,4321’.
  2846. A value of ‘"\03"’ indicates repeated groups of three digits, as
  2847. normally used in the U.S.
  2848. In the standard ‘C’ locale, both ‘grouping’ and ‘mon_grouping’ have
  2849. a value of ‘""’. This value specifies no grouping at all.
  2850. ‘char int_frac_digits’
  2851. ‘char frac_digits’
  2852. These are small integers indicating how many fractional digits (to
  2853. the right of the decimal point) should be displayed in a monetary
  2854. value in international and local formats, respectively. (Most
  2855. often, both members have the same value.)
  2856. In the standard ‘C’ locale, both of these members have the value
  2857. ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
  2858. what to do when you find this value; we recommend printing no
  2859. fractional digits. (This locale also specifies the empty string
  2860. for ‘mon_decimal_point’, so printing any fractional digits would be
  2861. confusing!)
  2862. 
  2863. File: libc.info, Node: Currency Symbol, Next: Sign of Money Amount, Prev: General Numeric, Up: The Lame Way to Locale Data
  2864. 7.7.1.2 Printing the Currency Symbol
  2865. ....................................
  2866. These members of the ‘struct lconv’ structure specify how to print the
  2867. symbol to identify a monetary value--the international analog of ‘$’ for
  2868. US dollars.
  2869. Each country has two standard currency symbols. The “local currency
  2870. symbol” is used commonly within the country, while the “international
  2871. currency symbol” is used internationally to refer to that country's
  2872. currency when it is necessary to indicate the country unambiguously.
  2873. For example, many countries use the dollar as their monetary unit,
  2874. and when dealing with international currencies it's important to specify
  2875. that one is dealing with (say) Canadian dollars instead of U.S. dollars
  2876. or Australian dollars. But when the context is known to be Canada,
  2877. there is no need to make this explicit--dollar amounts are implicitly
  2878. assumed to be in Canadian dollars.
  2879. ‘char *currency_symbol’
  2880. The local currency symbol for the selected locale.
  2881. In the standard ‘C’ locale, this member has a value of ‘""’ (the
  2882. empty string), meaning "unspecified". The ISO standard doesn't say
  2883. what to do when you find this value; we recommend you simply print
  2884. the empty string as you would print any other string pointed to by
  2885. this variable.
  2886. ‘char *int_curr_symbol’
  2887. The international currency symbol for the selected locale.
  2888. The value of ‘int_curr_symbol’ should normally consist of a
  2889. three-letter abbreviation determined by the international standard
  2890. ‘ISO 4217 Codes for the Representation of Currency and Funds’,
  2891. followed by a one-character separator (often a space).
  2892. In the standard ‘C’ locale, this member has a value of ‘""’ (the
  2893. empty string), meaning "unspecified". We recommend you simply
  2894. print the empty string as you would print any other string pointed
  2895. to by this variable.
  2896. ‘char p_cs_precedes’
  2897. ‘char n_cs_precedes’
  2898. ‘char int_p_cs_precedes’
  2899. ‘char int_n_cs_precedes’
  2900. These members are ‘1’ if the ‘currency_symbol’ or ‘int_curr_symbol’
  2901. strings should precede the value of a monetary amount, or ‘0’ if
  2902. the strings should follow the value. The ‘p_cs_precedes’ and
  2903. ‘int_p_cs_precedes’ members apply to positive amounts (or zero),
  2904. and the ‘n_cs_precedes’ and ‘int_n_cs_precedes’ members apply to
  2905. negative amounts.
  2906. In the standard ‘C’ locale, all of these members have a value of
  2907. ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
  2908. what to do when you find this value. We recommend printing the
  2909. currency symbol before the amount, which is right for most
  2910. countries. In other words, treat all nonzero values alike in these
  2911. members.
  2912. The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
  2913. while the other two apply to ‘currency_symbol’.
  2914. ‘char p_sep_by_space’
  2915. ‘char n_sep_by_space’
  2916. ‘char int_p_sep_by_space’
  2917. ‘char int_n_sep_by_space’
  2918. These members are ‘1’ if a space should appear between the
  2919. ‘currency_symbol’ or ‘int_curr_symbol’ strings and the amount, or
  2920. ‘0’ if no space should appear. The ‘p_sep_by_space’ and
  2921. ‘int_p_sep_by_space’ members apply to positive amounts (or zero),
  2922. and the ‘n_sep_by_space’ and ‘int_n_sep_by_space’ members apply to
  2923. negative amounts.
  2924. In the standard ‘C’ locale, all of these members have a value of
  2925. ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
  2926. what you should do when you find this value; we suggest you treat
  2927. it as 1 (print a space). In other words, treat all nonzero values
  2928. alike in these members.
  2929. The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
  2930. while the other two apply to ‘currency_symbol’. There is one
  2931. specialty with the ‘int_curr_symbol’, though. Since all legal
  2932. values contain a space at the end of the string one either prints
  2933. this space (if the currency symbol must appear in front and must be
  2934. separated) or one has to avoid printing this character at all
  2935. (especially when at the end of the string).
  2936. 
  2937. File: libc.info, Node: Sign of Money Amount, Prev: Currency Symbol, Up: The Lame Way to Locale Data
  2938. 7.7.1.3 Printing the Sign of a Monetary Amount
  2939. ..............................................
  2940. These members of the ‘struct lconv’ structure specify how to print the
  2941. sign (if any) of a monetary value.
  2942. ‘char *positive_sign’
  2943. ‘char *negative_sign’
  2944. These are strings used to indicate positive (or zero) and negative
  2945. monetary quantities, respectively.
  2946. In the standard ‘C’ locale, both of these members have a value of
  2947. ‘""’ (the empty string), meaning "unspecified".
  2948. The ISO standard doesn't say what to do when you find this value;
  2949. we recommend printing ‘positive_sign’ as you find it, even if it is
  2950. empty. For a negative value, print ‘negative_sign’ as you find it
  2951. unless both it and ‘positive_sign’ are empty, in which case print
  2952. ‘-’ instead. (Failing to indicate the sign at all seems rather
  2953. unreasonable.)
  2954. ‘char p_sign_posn’
  2955. ‘char n_sign_posn’
  2956. ‘char int_p_sign_posn’
  2957. ‘char int_n_sign_posn’
  2958. These members are small integers that indicate how to position the
  2959. sign for nonnegative and negative monetary quantities,
  2960. respectively. (The string used for the sign is what was specified
  2961. with ‘positive_sign’ or ‘negative_sign’.) The possible values are
  2962. as follows:
  2963. ‘0’
  2964. The currency symbol and quantity should be surrounded by
  2965. parentheses.
  2966. ‘1’
  2967. Print the sign string before the quantity and currency symbol.
  2968. ‘2’
  2969. Print the sign string after the quantity and currency symbol.
  2970. ‘3’
  2971. Print the sign string right before the currency symbol.
  2972. ‘4’
  2973. Print the sign string right after the currency symbol.
  2974. ‘CHAR_MAX’
  2975. "Unspecified". Both members have this value in the standard
  2976. ‘C’ locale.
  2977. The ISO standard doesn't say what you should do when the value is
  2978. ‘CHAR_MAX’. We recommend you print the sign after the currency
  2979. symbol.
  2980. The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
  2981. while the other two apply to ‘currency_symbol’.
  2982. 
  2983. File: libc.info, Node: The Elegant and Fast Way, Prev: The Lame Way to Locale Data, Up: Locale Information
  2984. 7.7.2 Pinpoint Access to Locale Data
  2985. ------------------------------------
  2986. When writing the X/Open Portability Guide the authors realized that the
  2987. ‘localeconv’ function is not enough to provide reasonable access to
  2988. locale information. The information which was meant to be available in
  2989. the locale (as later specified in the POSIX.1 standard) requires more
  2990. ways to access it. Therefore the ‘nl_langinfo’ function was introduced.
  2991. -- Function: char * nl_langinfo (nl_item ITEM)
  2992. Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
  2993. Safety Concepts::.
  2994. The ‘nl_langinfo’ function can be used to access individual
  2995. elements of the locale categories. Unlike the ‘localeconv’
  2996. function, which returns all the information, ‘nl_langinfo’ lets the
  2997. caller select what information it requires. This is very fast and
  2998. it is not a problem to call this function multiple times.
  2999. A second advantage is that in addition to the numeric and monetary
  3000. formatting information, information from the ‘LC_TIME’ and
  3001. ‘LC_MESSAGES’ categories is available.
  3002. The type ‘nl_item’ is defined in ‘nl_types.h’. The argument ITEM
  3003. is a numeric value defined in the header ‘langinfo.h’. The X/Open
  3004. standard defines the following values:
  3005. ‘CODESET’
  3006. ‘nl_langinfo’ returns a string with the name of the coded
  3007. character set used in the selected locale.
  3008. ‘ABDAY_1’
  3009. ‘ABDAY_2’
  3010. ‘ABDAY_3’
  3011. ‘ABDAY_4’
  3012. ‘ABDAY_5’
  3013. ‘ABDAY_6’
  3014. ‘ABDAY_7’
  3015. ‘nl_langinfo’ returns the abbreviated weekday name. ‘ABDAY_1’
  3016. corresponds to Sunday.
  3017. ‘DAY_1’
  3018. ‘DAY_2’
  3019. ‘DAY_3’
  3020. ‘DAY_4’
  3021. ‘DAY_5’
  3022. ‘DAY_6’
  3023. ‘DAY_7’
  3024. Similar to ‘ABDAY_1’, etc., but here the return value is the
  3025. unabbreviated weekday name.
  3026. ‘ABMON_1’
  3027. ‘ABMON_2’
  3028. ‘ABMON_3’
  3029. ‘ABMON_4’
  3030. ‘ABMON_5’
  3031. ‘ABMON_6’
  3032. ‘ABMON_7’
  3033. ‘ABMON_8’
  3034. ‘ABMON_9’
  3035. ‘ABMON_10’
  3036. ‘ABMON_11’
  3037. ‘ABMON_12’
  3038. The return value is the abbreviated name of the month, in the
  3039. grammatical form used when the month forms part of a complete
  3040. date. ‘ABMON_1’ corresponds to January.
  3041. ‘MON_1’
  3042. ‘MON_2’
  3043. ‘MON_3’
  3044. ‘MON_4’
  3045. ‘MON_5’
  3046. ‘MON_6’
  3047. ‘MON_7’
  3048. ‘MON_8’
  3049. ‘MON_9’
  3050. ‘MON_10’
  3051. ‘MON_11’
  3052. ‘MON_12’
  3053. Similar to ‘ABMON_1’, etc., but here the month names are not
  3054. abbreviated. Here the first value ‘MON_1’ also corresponds to
  3055. January.
  3056. ‘ALTMON_1’
  3057. ‘ALTMON_2’
  3058. ‘ALTMON_3’
  3059. ‘ALTMON_4’
  3060. ‘ALTMON_5’
  3061. ‘ALTMON_6’
  3062. ‘ALTMON_7’
  3063. ‘ALTMON_8’
  3064. ‘ALTMON_9’
  3065. ‘ALTMON_10’
  3066. ‘ALTMON_11’
  3067. ‘ALTMON_12’
  3068. Similar to ‘MON_1’, etc., but here the month names are in the
  3069. grammatical form used when the month is named by itself. The
  3070. ‘strftime’ functions use these month names for the conversion
  3071. specifier ‘%OB’ (*note Formatting Calendar Time::).
  3072. Note that not all languages need two different forms of the
  3073. month names, so the strings returned for ‘MON_...’ and
  3074. ‘ALTMON_...’ may or may not be the same, depending on the
  3075. locale.
  3076. *NB:* ‘ABALTMON_...’ constants corresponding to the ‘%Ob’
  3077. conversion specifier are not currently provided, but are
  3078. expected to be in a future release. In the meantime, it is
  3079. possible to use ‘_NL_ABALTMON_...’.
  3080. ‘AM_STR’
  3081. ‘PM_STR’
  3082. The return values are strings which can be used in the
  3083. representation of time as an hour from 1 to 12 plus an am/pm
  3084. specifier.
  3085. Note that in locales which do not use this time representation
  3086. these strings might be empty, in which case the am/pm format
  3087. cannot be used at all.
  3088. ‘D_T_FMT’
  3089. The return value can be used as a format string for ‘strftime’
  3090. to represent time and date in a locale-specific way.
  3091. ‘D_FMT’
  3092. The return value can be used as a format string for ‘strftime’
  3093. to represent a date in a locale-specific way.
  3094. ‘T_FMT’
  3095. The return value can be used as a format string for ‘strftime’
  3096. to represent time in a locale-specific way.
  3097. ‘T_FMT_AMPM’
  3098. The return value can be used as a format string for ‘strftime’
  3099. to represent time in the am/pm format.
  3100. Note that if the am/pm format does not make any sense for the
  3101. selected locale, the return value might be the same as the one
  3102. for ‘T_FMT’.
  3103. ‘ERA’
  3104. The return value represents the era used in the current
  3105. locale.
  3106. Most locales do not define this value. An example of a locale
  3107. which does define this value is the Japanese one. In Japan,
  3108. the traditional representation of dates includes the name of
  3109. the era corresponding to the then-emperor's reign.
  3110. Normally it should not be necessary to use this value
  3111. directly. Specifying the ‘E’ modifier in their format strings
  3112. causes the ‘strftime’ functions to use this information. The
  3113. format of the returned string is not specified, and therefore
  3114. you should not assume knowledge of it on different systems.
  3115. ‘ERA_YEAR’
  3116. The return value gives the year in the relevant era of the
  3117. locale. As for ‘ERA’ it should not be necessary to use this
  3118. value directly.
  3119. ‘ERA_D_T_FMT’
  3120. This return value can be used as a format string for
  3121. ‘strftime’ to represent dates and times in a locale-specific
  3122. era-based way.
  3123. ‘ERA_D_FMT’
  3124. This return value can be used as a format string for
  3125. ‘strftime’ to represent a date in a locale-specific era-based
  3126. way.
  3127. ‘ERA_T_FMT’
  3128. This return value can be used as a format string for
  3129. ‘strftime’ to represent time in a locale-specific era-based
  3130. way.
  3131. ‘ALT_DIGITS’
  3132. The return value is a representation of up to 100 values used
  3133. to represent the values 0 to 99. As for ‘ERA’ this value is
  3134. not intended to be used directly, but instead indirectly
  3135. through the ‘strftime’ function. When the modifier ‘O’ is
  3136. used in a format which would otherwise use numerals to
  3137. represent hours, minutes, seconds, weekdays, months, or weeks,
  3138. the appropriate value for the locale is used instead.
  3139. ‘INT_CURR_SYMBOL’
  3140. The same as the value returned by ‘localeconv’ in the
  3141. ‘int_curr_symbol’ element of the ‘struct lconv’.
  3142. ‘CURRENCY_SYMBOL’
  3143. ‘CRNCYSTR’
  3144. The same as the value returned by ‘localeconv’ in the
  3145. ‘currency_symbol’ element of the ‘struct lconv’.
  3146. ‘CRNCYSTR’ is a deprecated alias still required by Unix98.
  3147. ‘MON_DECIMAL_POINT’
  3148. The same as the value returned by ‘localeconv’ in the
  3149. ‘mon_decimal_point’ element of the ‘struct lconv’.
  3150. ‘MON_THOUSANDS_SEP’
  3151. The same as the value returned by ‘localeconv’ in the
  3152. ‘mon_thousands_sep’ element of the ‘struct lconv’.
  3153. ‘MON_GROUPING’
  3154. The same as the value returned by ‘localeconv’ in the
  3155. ‘mon_grouping’ element of the ‘struct lconv’.
  3156. ‘POSITIVE_SIGN’
  3157. The same as the value returned by ‘localeconv’ in the
  3158. ‘positive_sign’ element of the ‘struct lconv’.
  3159. ‘NEGATIVE_SIGN’
  3160. The same as the value returned by ‘localeconv’ in the
  3161. ‘negative_sign’ element of the ‘struct lconv’.
  3162. ‘INT_FRAC_DIGITS’
  3163. The same as the value returned by ‘localeconv’ in the
  3164. ‘int_frac_digits’ element of the ‘struct lconv’.
  3165. ‘FRAC_DIGITS’
  3166. The same as the value returned by ‘localeconv’ in the
  3167. ‘frac_digits’ element of the ‘struct lconv’.
  3168. ‘P_CS_PRECEDES’
  3169. The same as the value returned by ‘localeconv’ in the
  3170. ‘p_cs_precedes’ element of the ‘struct lconv’.
  3171. ‘P_SEP_BY_SPACE’
  3172. The same as the value returned by ‘localeconv’ in the
  3173. ‘p_sep_by_space’ element of the ‘struct lconv’.
  3174. ‘N_CS_PRECEDES’
  3175. The same as the value returned by ‘localeconv’ in the
  3176. ‘n_cs_precedes’ element of the ‘struct lconv’.
  3177. ‘N_SEP_BY_SPACE’
  3178. The same as the value returned by ‘localeconv’ in the
  3179. ‘n_sep_by_space’ element of the ‘struct lconv’.
  3180. ‘P_SIGN_POSN’
  3181. The same as the value returned by ‘localeconv’ in the
  3182. ‘p_sign_posn’ element of the ‘struct lconv’.
  3183. ‘N_SIGN_POSN’
  3184. The same as the value returned by ‘localeconv’ in the
  3185. ‘n_sign_posn’ element of the ‘struct lconv’.
  3186. ‘INT_P_CS_PRECEDES’
  3187. The same as the value returned by ‘localeconv’ in the
  3188. ‘int_p_cs_precedes’ element of the ‘struct lconv’.
  3189. ‘INT_P_SEP_BY_SPACE’
  3190. The same as the value returned by ‘localeconv’ in the
  3191. ‘int_p_sep_by_space’ element of the ‘struct lconv’.
  3192. ‘INT_N_CS_PRECEDES’
  3193. The same as the value returned by ‘localeconv’ in the
  3194. ‘int_n_cs_precedes’ element of the ‘struct lconv’.
  3195. ‘INT_N_SEP_BY_SPACE’
  3196. The same as the value returned by ‘localeconv’ in the
  3197. ‘int_n_sep_by_space’ element of the ‘struct lconv’.
  3198. ‘INT_P_SIGN_POSN’
  3199. The same as the value returned by ‘localeconv’ in the
  3200. ‘int_p_sign_posn’ element of the ‘struct lconv’.
  3201. ‘INT_N_SIGN_POSN’
  3202. The same as the value returned by ‘localeconv’ in the
  3203. ‘int_n_sign_posn’ element of the ‘struct lconv’.
  3204. ‘DECIMAL_POINT’
  3205. ‘RADIXCHAR’
  3206. The same as the value returned by ‘localeconv’ in the
  3207. ‘decimal_point’ element of the ‘struct lconv’.
  3208. The name ‘RADIXCHAR’ is a deprecated alias still used in
  3209. Unix98.
  3210. ‘THOUSANDS_SEP’
  3211. ‘THOUSEP’
  3212. The same as the value returned by ‘localeconv’ in the
  3213. ‘thousands_sep’ element of the ‘struct lconv’.
  3214. The name ‘THOUSEP’ is a deprecated alias still used in Unix98.
  3215. ‘GROUPING’
  3216. The same as the value returned by ‘localeconv’ in the
  3217. ‘grouping’ element of the ‘struct lconv’.
  3218. ‘YESEXPR’
  3219. The return value is a regular expression which can be used
  3220. with the ‘regex’ function to recognize a positive response to
  3221. a yes/no question. The GNU C Library provides the ‘rpmatch’
  3222. function for easier handling in applications.
  3223. ‘NOEXPR’
  3224. The return value is a regular expression which can be used
  3225. with the ‘regex’ function to recognize a negative response to
  3226. a yes/no question.
  3227. ‘YESSTR’
  3228. The return value is a locale-specific translation of the
  3229. positive response to a yes/no question.
  3230. Using this value is deprecated since it is a very special case
  3231. of message translation, and is better handled by the message
  3232. translation functions (*note Message Translation::).
  3233. The use of this symbol is deprecated. Instead message
  3234. translation should be used.
  3235. ‘NOSTR’
  3236. The return value is a locale-specific translation of the
  3237. negative response to a yes/no question. What is said for
  3238. ‘YESSTR’ is also true here.
  3239. The use of this symbol is deprecated. Instead message
  3240. translation should be used.
  3241. The file ‘langinfo.h’ defines a lot more symbols but none of them
  3242. are official. Using them is not portable, and the format of the
  3243. return values might change. Therefore we recommended you not use
  3244. them.
  3245. Note that the return value for any valid argument can be used in
  3246. all situations (with the possible exception of the am/pm time
  3247. formatting codes). If the user has not selected any locale for the
  3248. appropriate category, ‘nl_langinfo’ returns the information from
  3249. the ‘"C"’ locale. It is therefore possible to use this function as
  3250. shown in the example below.
  3251. If the argument ITEM is not valid, a pointer to an empty string is
  3252. returned.
  3253. An example of ‘nl_langinfo’ usage is a function which has to print a
  3254. given date and time in a locale-specific way. At first one might think
  3255. that, since ‘strftime’ internally uses the locale information, writing
  3256. something like the following is enough:
  3257. size_t
  3258. i18n_time_n_data (char *s, size_t len, const struct tm *tp)
  3259. {
  3260. return strftime (s, len, "%X %D", tp);
  3261. }
  3262. The format contains no weekday or month names and therefore is
  3263. internationally usable. Wrong! The output produced is something like
  3264. ‘"hh:mm:ss MM/DD/YY"’. This format is only recognizable in the USA.
  3265. Other countries use different formats. Therefore the function should be
  3266. rewritten like this:
  3267. size_t
  3268. i18n_time_n_data (char *s, size_t len, const struct tm *tp)
  3269. {
  3270. return strftime (s, len, nl_langinfo (D_T_FMT), tp);
  3271. }
  3272. Now it uses the date and time format of the locale selected when the
  3273. program runs. If the user selects the locale correctly there should
  3274. never be a misunderstanding over the time and date format.
  3275. 
  3276. File: libc.info, Node: Formatting Numbers, Next: Yes-or-No Questions, Prev: Locale Information, Up: Locales
  3277. 7.8 A dedicated function to format numbers
  3278. ==========================================
  3279. We have seen that the structure returned by ‘localeconv’ as well as the
  3280. values given to ‘nl_langinfo’ allow you to retrieve the various pieces
  3281. of locale-specific information to format numbers and monetary amounts.
  3282. We have also seen that the underlying rules are quite complex.
  3283. Therefore the X/Open standards introduce a function which uses such
  3284. locale information, making it easier for the user to format numbers
  3285. according to these rules.
  3286. -- Function: ssize_t strfmon (char *S, size_t MAXSIZE, const char
  3287. *FORMAT, ...)
  3288. Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
  3289. *Note POSIX Safety Concepts::.
  3290. The ‘strfmon’ function is similar to the ‘strftime’ function in
  3291. that it takes a buffer, its size, a format string, and values to
  3292. write into the buffer as text in a form specified by the format
  3293. string. Like ‘strftime’, the function also returns the number of
  3294. bytes written into the buffer.
  3295. There are two differences: ‘strfmon’ can take more than one
  3296. argument, and, of course, the format specification is different.
  3297. Like ‘strftime’, the format string consists of normal text, which
  3298. is output as is, and format specifiers, which are indicated by a
  3299. ‘%’. Immediately after the ‘%’, you can optionally specify various
  3300. flags and formatting information before the main formatting
  3301. character, in a similar way to ‘printf’:
  3302. • Immediately following the ‘%’ there can be one or more of the
  3303. following flags:
  3304. ‘=F’
  3305. The single byte character F is used for this field as the
  3306. numeric fill character. By default this character is a
  3307. space character. Filling with this character is only
  3308. performed if a left precision is specified. It is not
  3309. just to fill to the given field width.
  3310. ‘^’
  3311. The number is printed without grouping the digits
  3312. according to the rules of the current locale. By default
  3313. grouping is enabled.
  3314. ‘+’, ‘(’
  3315. At most one of these flags can be used. They select
  3316. which format to represent the sign of a currency amount.
  3317. By default, and if ‘+’ is given, the locale equivalent of
  3318. +/- is used. If ‘(’ is given, negative amounts are
  3319. enclosed in parentheses. The exact format is determined
  3320. by the values of the ‘LC_MONETARY’ category of the locale
  3321. selected at program runtime.
  3322. ‘!’
  3323. The output will not contain the currency symbol.
  3324. ‘-’
  3325. The output will be formatted left-justified instead of
  3326. right-justified if it does not fill the entire field
  3327. width.
  3328. The next part of the specification is an optional field width. If
  3329. no width is specified 0 is taken. During output, the function
  3330. first determines how much space is required. If it requires at
  3331. least as many characters as given by the field width, it is output
  3332. using as much space as necessary. Otherwise, it is extended to use
  3333. the full width by filling with the space character. The presence
  3334. or absence of the ‘-’ flag determines the side at which such
  3335. padding occurs. If present, the spaces are added at the right
  3336. making the output left-justified, and vice versa.
  3337. So far the format looks familiar, being similar to the ‘printf’ and
  3338. ‘strftime’ formats. However, the next two optional fields
  3339. introduce something new. The first one is a ‘#’ character followed
  3340. by a decimal digit string. The value of the digit string specifies
  3341. the number of _digit_ positions to the left of the decimal point
  3342. (or equivalent). This does _not_ include the grouping character
  3343. when the ‘^’ flag is not given. If the space needed to print the
  3344. number does not fill the whole width, the field is padded at the
  3345. left side with the fill character, which can be selected using the
  3346. ‘=’ flag and by default is a space. For example, if the field
  3347. width is selected as 6 and the number is 123, the fill character is
  3348. ‘*’ the result will be ‘***123’.
  3349. The second optional field starts with a ‘.’ (period) and consists
  3350. of another decimal digit string. Its value describes the number of
  3351. characters printed after the decimal point. The default is
  3352. selected from the current locale (‘frac_digits’, ‘int_frac_digits’,
  3353. see *note General Numeric::). If the exact representation needs
  3354. more digits than given by the field width, the displayed value is
  3355. rounded. If the number of fractional digits is selected to be
  3356. zero, no decimal point is printed.
  3357. As a GNU extension, the ‘strfmon’ implementation in the GNU C
  3358. Library allows an optional ‘L’ next as a format modifier. If this
  3359. modifier is given, the argument is expected to be a ‘long double’
  3360. instead of a ‘double’ value.
  3361. Finally, the last component is a format specifier. There are three
  3362. specifiers defined:
  3363. ‘i’
  3364. Use the locale's rules for formatting an international
  3365. currency value.
  3366. ‘n’
  3367. Use the locale's rules for formatting a national currency
  3368. value.
  3369. ‘%’
  3370. Place a ‘%’ in the output. There must be no flag, width
  3371. specifier or modifier given, only ‘%%’ is allowed.
  3372. As for ‘printf’, the function reads the format string from left to
  3373. right and uses the values passed to the function following the
  3374. format string. The values are expected to be either of type
  3375. ‘double’ or ‘long double’, depending on the presence of the
  3376. modifier ‘L’. The result is stored in the buffer pointed to by S.
  3377. At most MAXSIZE characters are stored.
  3378. The return value of the function is the number of characters stored
  3379. in S, including the terminating ‘NULL’ byte. If the number of
  3380. characters stored would exceed MAXSIZE, the function returns -1 and
  3381. the content of the buffer S is unspecified. In this case ‘errno’
  3382. is set to ‘E2BIG’.
  3383. A few examples should make clear how the function works. It is
  3384. assumed that all the following pieces of code are executed in a program
  3385. which uses the USA locale (‘en_US’). The simplest form of the format is
  3386. this:
  3387. strfmon (buf, 100, "@%n@%n@%n@", 123.45, -567.89, 12345.678);
  3388. The output produced is
  3389. "@$123.45@-$567.89@$12,345.68@"
  3390. We can notice several things here. First, the widths of the output
  3391. numbers are different. We have not specified a width in the format
  3392. string, and so this is no wonder. Second, the third number is printed
  3393. using thousands separators. The thousands separator for the ‘en_US’
  3394. locale is a comma. The number is also rounded. .678 is rounded to .68
  3395. since the format does not specify a precision and the default value in
  3396. the locale is 2. Finally, note that the national currency symbol is
  3397. printed since ‘%n’ was used, not ‘i’. The next example shows how we can
  3398. align the output.
  3399. strfmon (buf, 100, "@%=*11n@%=*11n@%=*11n@", 123.45, -567.89, 12345.678);
  3400. The output this time is:
  3401. "@ $123.45@ -$567.89@ $12,345.68@"
  3402. Two things stand out. Firstly, all fields have the same width
  3403. (eleven characters) since this is the width given in the format and
  3404. since no number required more characters to be printed. The second
  3405. important point is that the fill character is not used. This is correct
  3406. since the white space was not used to achieve a precision given by a ‘#’
  3407. modifier, but instead to fill to the given width. The difference
  3408. becomes obvious if we now add a width specification.
  3409. strfmon (buf, 100, "@%=*11#5n@%=*11#5n@%=*11#5n@",
  3410. 123.45, -567.89, 12345.678);
  3411. The output is
  3412. "@ $***123.45@-$***567.89@ $12,456.68@"
  3413. Here we can see that all the currency symbols are now aligned, and
  3414. that the space between the currency sign and the number is filled with
  3415. the selected fill character. Note that although the width is selected
  3416. to be 5 and 123.45 has three digits left of the decimal point, the space
  3417. is filled with three asterisks. This is correct since, as explained
  3418. above, the width does not include the positions used to store thousands
  3419. separators. One last example should explain the remaining
  3420. functionality.
  3421. strfmon (buf, 100, "@%=0(16#5.3i@%=0(16#5.3i@%=0(16#5.3i@",
  3422. 123.45, -567.89, 12345.678);
  3423. This rather complex format string produces the following output:
  3424. "@ USD 000123,450 @(USD 000567.890)@ USD 12,345.678 @"
  3425. The most noticeable change is the alternative way of representing
  3426. negative numbers. In financial circles this is often done using
  3427. parentheses, and this is what the ‘(’ flag selected. The fill character
  3428. is now ‘0’. Note that this ‘0’ character is not regarded as a numeric
  3429. zero, and therefore the first and second numbers are not printed using a
  3430. thousands separator. Since we used the format specifier ‘i’ instead of
  3431. ‘n’, the international form of the currency symbol is used. This is a
  3432. four letter string, in this case ‘"USD "’. The last point is that since
  3433. the precision right of the decimal point is selected to be three, the
  3434. first and second numbers are printed with an extra zero at the end and
  3435. the third number is printed without rounding.
  3436. 
  3437. File: libc.info, Node: Yes-or-No Questions, Prev: Formatting Numbers, Up: Locales
  3438. 7.9 Yes-or-No Questions
  3439. =======================
  3440. Some non GUI programs ask a yes-or-no question. If the messages
  3441. (especially the questions) are translated into foreign languages, be
  3442. sure that you localize the answers too. It would be very bad habit to
  3443. ask a question in one language and request the answer in another, often
  3444. English.
  3445. The GNU C Library contains ‘rpmatch’ to give applications easy access
  3446. to the corresponding locale definitions.
  3447. -- Function: int rpmatch (const char *RESPONSE)
  3448. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap lock dlopen
  3449. | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety Concepts::.
  3450. The function ‘rpmatch’ checks the string in RESPONSE for whether or
  3451. not it is a correct yes-or-no answer and if yes, which one. The
  3452. check uses the ‘YESEXPR’ and ‘NOEXPR’ data in the ‘LC_MESSAGES’
  3453. category of the currently selected locale. The return value is as
  3454. follows:
  3455. ‘1’
  3456. The user entered an affirmative answer.
  3457. ‘0’
  3458. The user entered a negative answer.
  3459. ‘-1’
  3460. The answer matched neither the ‘YESEXPR’ nor the ‘NOEXPR’
  3461. regular expression.
  3462. This function is not standardized but available beside in the GNU C
  3463. Library at least also in the IBM AIX library.
  3464. This function would normally be used like this:
  3465. ...
  3466. /* Use a safe default. */
  3467. _Bool doit = false;
  3468. fputs (gettext ("Do you really want to do this? "), stdout);
  3469. fflush (stdout);
  3470. /* Prepare the ‘getline’ call. */
  3471. line = NULL;
  3472. len = 0;
  3473. while (getline (&line, &len, stdin) >= 0)
  3474. {
  3475. /* Check the response. */
  3476. int res = rpmatch (line);
  3477. if (res >= 0)
  3478. {
  3479. /* We got a definitive answer. */
  3480. if (res > 0)
  3481. doit = true;
  3482. break;
  3483. }
  3484. }
  3485. /* Free what ‘getline’ allocated. */
  3486. free (line);
  3487. Note that the loop continues until a read error is detected or until
  3488. a definitive (positive or negative) answer is read.
  3489. 
  3490. File: libc.info, Node: Message Translation, Next: Searching and Sorting, Prev: Locales, Up: Top
  3491. 8 Message Translation
  3492. *********************
  3493. The program's interface with the user should be designed to ease the
  3494. user's task. One way to ease the user's task is to use messages in
  3495. whatever language the user prefers.
  3496. Printing messages in different languages can be implemented in
  3497. different ways. One could add all the different languages in the source
  3498. code and choose among the variants every time a message has to be
  3499. printed. This is certainly not a good solution since extending the set
  3500. of languages is cumbersome (the code must be changed) and the code
  3501. itself can become really big with dozens of message sets.
  3502. A better solution is to keep the message sets for each language in
  3503. separate files which are loaded at runtime depending on the language
  3504. selection of the user.
  3505. The GNU C Library provides two different sets of functions to support
  3506. message translation. The ‘catgets’ family of functions were previously
  3507. the only family defined in the X/Open standard but they were derived
  3508. from industry decisions and therefore not necessarily based on
  3509. reasonable decisions. However, the preferable ‘gettext’ family of
  3510. functions was standardized in POSIX-1.2024.
  3511. As mentioned above, the message catalog handling provides easy
  3512. extendability by using external data files which contain the message
  3513. translations. I.e., these files contain for each of the messages used
  3514. in the program a translation for the appropriate language. So the tasks
  3515. of the message handling functions are
  3516. • locate the external data file with the appropriate translations
  3517. • load the data and make it possible to address the messages
  3518. • map a given key to the translated message
  3519. The two approaches mainly differ in the implementation of this last
  3520. step. Decisions made in the last step influence the rest of the design.
  3521. * Menu:
  3522. * Message catalogs a la X/Open:: The ‘catgets’ family of functions.
  3523. * The Uniforum approach:: The ‘gettext’ family of functions.
  3524. 
  3525. File: libc.info, Node: Message catalogs a la X/Open, Next: The Uniforum approach, Up: Message Translation
  3526. 8.1 X/Open Message Catalog Handling
  3527. ===================================
  3528. The ‘catgets’ functions are based on the simple scheme:
  3529. Associate every message to translate in the source code with a
  3530. unique identifier. To retrieve a message from a catalog file
  3531. solely the identifier is used.
  3532. This means for the author of the program that s/he will have to make
  3533. sure the meaning of the identifier in the program code and in the
  3534. message catalogs is always the same.
  3535. Before a message can be translated the catalog file must be located.
  3536. The user of the program must be able to guide the responsible function
  3537. to find whatever catalog the user wants. This is separated from what
  3538. the programmer had in mind.
  3539. All the types, constants and functions for the ‘catgets’ functions
  3540. are defined/declared in the ‘nl_types.h’ header file.
  3541. * Menu:
  3542. * The catgets Functions:: The ‘catgets’ function family.
  3543. * The message catalog files:: Format of the message catalog files.
  3544. * The gencat program:: How to generate message catalogs files which
  3545. can be used by the functions.
  3546. * Common Usage:: How to use the ‘catgets’ interface.
  3547. 
  3548. File: libc.info, Node: The catgets Functions, Next: The message catalog files, Up: Message catalogs a la X/Open
  3549. 8.1.1 The ‘catgets’ function family
  3550. -----------------------------------
  3551. -- Function: nl_catd catopen (const char *CAT_NAME, int FLAG)
  3552. Preliminary: | MT-Safe env | AS-Unsafe heap | AC-Unsafe mem | *Note
  3553. POSIX Safety Concepts::.
  3554. The ‘catopen’ function tries to locate the message data file named
  3555. CAT_NAME and loads it when found. The return value is of an opaque
  3556. type and can be used in calls to the other functions to refer to
  3557. this loaded catalog.
  3558. The return value is ‘(nl_catd) -1’ in case the function failed and
  3559. no catalog was loaded. The global variable ‘errno’ contains a code
  3560. for the error causing the failure. But even if the function call
  3561. succeeded this does not mean that all messages can be translated.
  3562. Locating the catalog file must happen in a way which lets the user
  3563. of the program influence the decision. It is up to the user to
  3564. decide about the language to use and sometimes it is useful to use
  3565. alternate catalog files. All this can be specified by the user by
  3566. setting some environment variables.
  3567. The first problem is to find out where all the message catalogs are
  3568. stored. Every program could have its own place to keep all the
  3569. different files but usually the catalog files are grouped by
  3570. languages and the catalogs for all programs are kept in the same
  3571. place.
  3572. To tell the ‘catopen’ function where the catalog for the program
  3573. can be found the user can set the environment variable ‘NLSPATH’ to
  3574. a value which describes her/his choice. Since this value must be
  3575. usable for different languages and locales it cannot be a simple
  3576. string. Instead it is a format string (similar to ‘printf’'s). An
  3577. example is
  3578. /usr/share/locale/%L/%N:/usr/share/locale/%L/LC_MESSAGES/%N
  3579. First one can see that more than one directory can be specified
  3580. (with the usual syntax of separating them by colons). The next
  3581. things to observe are the format string, ‘%L’ and ‘%N’ in this
  3582. case. The ‘catopen’ function knows about several of them and the
  3583. replacement for all of them is of course different.
  3584. ‘%N’
  3585. This format element is substituted with the name of the
  3586. catalog file. This is the value of the CAT_NAME argument
  3587. given to ‘catgets’.
  3588. ‘%L’
  3589. This format element is substituted with the name of the
  3590. currently selected locale for translating messages. How this
  3591. is determined is explained below.
  3592. ‘%l’
  3593. (This is the lowercase ell.) This format element is
  3594. substituted with the language element of the locale name. The
  3595. string describing the selected locale is expected to have the
  3596. form ‘LANG[_TERR[.CODESET]]’ and this format uses the first
  3597. part LANG.
  3598. ‘%t’
  3599. This format element is substituted by the territory part TERR
  3600. of the name of the currently selected locale. See the
  3601. explanation of the format above.
  3602. ‘%c’
  3603. This format element is substituted by the codeset part CODESET
  3604. of the name of the currently selected locale. See the
  3605. explanation of the format above.
  3606. ‘%%’
  3607. Since ‘%’ is used as a meta character there must be a way to
  3608. express the ‘%’ character in the result itself. Using ‘%%’
  3609. does this just like it works for ‘printf’.
  3610. Using ‘NLSPATH’ allows arbitrary directories to be searched for
  3611. message catalogs while still allowing different languages to be
  3612. used. If the ‘NLSPATH’ environment variable is not set, the
  3613. default value is
  3614. PREFIX/share/locale/%L/%N:PREFIX/share/locale/%L/LC_MESSAGES/%N
  3615. where PREFIX is given to ‘configure’ while installing the GNU C
  3616. Library (this value is in many cases ‘/usr’ or the empty string).
  3617. The remaining problem is to decide which must be used. The value
  3618. decides about the substitution of the format elements mentioned
  3619. above. First of all the user can specify a path in the message
  3620. catalog name (i.e., the name contains a slash character). In this
  3621. situation the ‘NLSPATH’ environment variable is not used. The
  3622. catalog must exist as specified in the program, perhaps relative to
  3623. the current working directory. This situation in not desirable and
  3624. catalogs names never should be written this way. Beside this, this
  3625. behavior is not portable to all other platforms providing the
  3626. ‘catgets’ interface.
  3627. Otherwise the values of environment variables from the standard
  3628. environment are examined (*note Standard Environment::). Which
  3629. variables are examined is decided by the FLAG parameter of
  3630. ‘catopen’. If the value is ‘NL_CAT_LOCALE’ (which is defined in
  3631. ‘nl_types.h’) then the ‘catopen’ function uses the name of the
  3632. locale currently selected for the ‘LC_MESSAGES’ category.
  3633. If FLAG is zero the ‘LANG’ environment variable is examined. This
  3634. is a left-over from the early days when the concept of locales had
  3635. not even reached the level of POSIX locales.
  3636. The environment variable and the locale name should have a value of
  3637. the form ‘LANG[_TERR[.CODESET]]’ as explained above. If no
  3638. environment variable is set the ‘"C"’ locale is used which prevents
  3639. any translation.
  3640. The return value of the function is in any case a valid string.
  3641. Either it is a translation from a message catalog or it is the same
  3642. as the STRING parameter. So a piece of code to decide whether a
  3643. translation actually happened must look like this:
  3644. {
  3645. char *trans = catgets (desc, set, msg, input_string);
  3646. if (trans == input_string)
  3647. {
  3648. /* Something went wrong. */
  3649. }
  3650. }
  3651. When an error occurs the global variable ‘errno’ is set to
  3652. EBADF
  3653. The catalog does not exist.
  3654. ENOMSG
  3655. The set/message tuple does not name an existing element in the
  3656. message catalog.
  3657. While it sometimes can be useful to test for errors programs
  3658. normally will avoid any test. If the translation is not available
  3659. it is no big problem if the original, untranslated message is
  3660. printed. Either the user understands this as well or s/he will
  3661. look for the reason why the messages are not translated.
  3662. Please note that the currently selected locale does not depend on a
  3663. call to the ‘setlocale’ function. It is not necessary that the locale
  3664. data files for this locale exist and calling ‘setlocale’ succeeds. The
  3665. ‘catopen’ function directly reads the values of the environment
  3666. variables.
  3667. -- Function: char * catgets (nl_catd CATALOG_DESC, int SET, int
  3668. MESSAGE, const char *STRING)
  3669. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  3670. Concepts::.
  3671. The function ‘catgets’ has to be used to access the message catalog
  3672. previously opened using the ‘catopen’ function. The CATALOG_DESC
  3673. parameter must be a value previously returned by ‘catopen’.
  3674. The next two parameters, SET and MESSAGE, reflect the internal
  3675. organization of the message catalog files. This will be explained
  3676. in detail below. For now it is interesting to know that a catalog
  3677. can consist of several sets and the messages in each thread are
  3678. individually numbered using numbers. Neither the set number nor
  3679. the message number must be consecutive. They can be arbitrarily
  3680. chosen. But each message (unless equal to another one) must have
  3681. its own unique pair of set and message numbers.
  3682. Since it is not guaranteed that the message catalog for the
  3683. language selected by the user exists the last parameter STRING
  3684. helps to handle this case gracefully. If no matching string can be
  3685. found STRING is returned. This means for the programmer that
  3686. • the STRING parameters should contain reasonable text (this
  3687. also helps to understand the program seems otherwise there
  3688. would be no hint on the string which is expected to be
  3689. returned.
  3690. • all STRING arguments should be written in the same language.
  3691. It is somewhat uncomfortable to write a program using the ‘catgets’
  3692. functions if no supporting functionality is available. Since each
  3693. set/message number tuple must be unique the programmer must keep lists
  3694. of the messages at the same time the code is written. And the work
  3695. between several people working on the same project must be coordinated.
  3696. We will see how some of these problems can be relaxed a bit (*note
  3697. Common Usage::).
  3698. -- Function: int catclose (nl_catd CATALOG_DESC)
  3699. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe corrupt mem |
  3700. *Note POSIX Safety Concepts::.
  3701. The ‘catclose’ function can be used to free the resources
  3702. associated with a message catalog which previously was opened by a
  3703. call to ‘catopen’. If the resources can be successfully freed the
  3704. function returns ‘0’. Otherwise it returns ‘−1’ and the global
  3705. variable ‘errno’ is set. Errors can occur if the catalog
  3706. descriptor CATALOG_DESC is not valid in which case ‘errno’ is set
  3707. to ‘EBADF’.
  3708. 
  3709. File: libc.info, Node: The message catalog files, Next: The gencat program, Prev: The catgets Functions, Up: Message catalogs a la X/Open
  3710. 8.1.2 Format of the message catalog files
  3711. -----------------------------------------
  3712. The only reasonable way to translate all the messages of a function and
  3713. store the result in a message catalog file which can be read by the
  3714. ‘catopen’ function is to write all the message text to the translator
  3715. and let her/him translate them all. I.e., we must have a file with
  3716. entries which associate the set/message tuple with a specific
  3717. translation. This file format is specified in the X/Open standard and
  3718. is as follows:
  3719. • Lines containing only whitespace characters or empty lines are
  3720. ignored.
  3721. • Lines which contain as the first non-whitespace character a ‘$’
  3722. followed by a whitespace character are comment and are also
  3723. ignored.
  3724. • If a line contains as the first non-whitespace characters the
  3725. sequence ‘$set’ followed by a whitespace character an additional
  3726. argument is required to follow. This argument can either be:
  3727. − a number. In this case the value of this number determines
  3728. the set to which the following messages are added.
  3729. − an identifier consisting of alphanumeric characters plus the
  3730. underscore character. In this case the set get automatically
  3731. a number assigned. This value is one added to the largest set
  3732. number which so far appeared.
  3733. How to use the symbolic names is explained in section *note
  3734. Common Usage::.
  3735. It is an error if a symbol name appears more than once. All
  3736. following messages are placed in a set with this number.
  3737. • If a line contains as the first non-whitespace characters the
  3738. sequence ‘$delset’ followed by a whitespace character an additional
  3739. argument is required to follow. This argument can either be:
  3740. − a number. In this case the value of this number determines
  3741. the set which will be deleted.
  3742. − an identifier consisting of alphanumeric characters plus the
  3743. underscore character. This symbolic identifier must match a
  3744. name for a set which previously was defined. It is an error
  3745. if the name is unknown.
  3746. In both cases all messages in the specified set will be removed.
  3747. They will not appear in the output. But if this set is later again
  3748. selected with a ‘$set’ command again messages could be added and
  3749. these messages will appear in the output.
  3750. • If a line contains after leading whitespaces the sequence ‘$quote’,
  3751. the quoting character used for this input file is changed to the
  3752. first non-whitespace character following ‘$quote’. If no
  3753. non-whitespace character is present before the line ends quoting is
  3754. disabled.
  3755. By default no quoting character is used. In this mode strings are
  3756. terminated with the first unescaped line break. If there is a
  3757. ‘$quote’ sequence present newline need not be escaped. Instead a
  3758. string is terminated with the first unescaped appearance of the
  3759. quote character.
  3760. A common usage of this feature would be to set the quote character
  3761. to ‘"’. Then any appearance of the ‘"’ in the strings must be
  3762. escaped using the backslash (i.e., ‘\"’ must be written).
  3763. • Any other line must start with a number or an alphanumeric
  3764. identifier (with the underscore character included). The following
  3765. characters (starting after the first whitespace character) will
  3766. form the string which gets associated with the currently selected
  3767. set and the message number represented by the number and identifier
  3768. respectively.
  3769. If the start of the line is a number the message number is obvious.
  3770. It is an error if the same message number already appeared for this
  3771. set.
  3772. If the leading token was an identifier the message number gets
  3773. automatically assigned. The value is the current maximum message
  3774. number for this set plus one. It is an error if the identifier was
  3775. already used for a message in this set. It is OK to reuse the
  3776. identifier for a message in another thread. How to use the
  3777. symbolic identifiers will be explained below (*note Common
  3778. Usage::). There is one limitation with the identifier: it must not
  3779. be ‘Set’. The reason will be explained below.
  3780. The text of the messages can contain escape characters. The usual
  3781. bunch of characters known from the ISO C language are recognized
  3782. (‘\n’, ‘\t’, ‘\v’, ‘\b’, ‘\r’, ‘\f’, ‘\\’, and ‘\NNN’, where NNN is
  3783. the octal coding of a character code).
  3784. *Important:* The handling of identifiers instead of numbers for the
  3785. set and messages is a GNU extension. Systems strictly following the
  3786. X/Open specification do not have this feature. An example for a message
  3787. catalog file is this:
  3788. $ This is a leading comment.
  3789. $quote "
  3790. $set SetOne
  3791. 1 Message with ID 1.
  3792. two " Message with ID \"two\", which gets the value 2 assigned"
  3793. $set SetTwo
  3794. $ Since the last set got the number 1 assigned this set has number 2.
  3795. 4000 "The numbers can be arbitrary, they need not start at one."
  3796. This small example shows various aspects:
  3797. • Lines 1 and 9 are comments since they start with ‘$’ followed by a
  3798. whitespace.
  3799. • The quoting character is set to ‘"’. Otherwise the quotes in the
  3800. message definition would have to be omitted and in this case the
  3801. message with the identifier ‘two’ would lose its leading
  3802. whitespace.
  3803. • Mixing numbered messages with messages having symbolic names is no
  3804. problem and the numbering happens automatically.
  3805. While this file format is pretty easy it is not the best possible for
  3806. use in a running program. The ‘catopen’ function would have to parse
  3807. the file and handle syntactic errors gracefully. This is not so easy
  3808. and the whole process is pretty slow. Therefore the ‘catgets’ functions
  3809. expect the data in another more compact and ready-to-use file format.
  3810. There is a special program ‘gencat’ which is explained in detail in the
  3811. next section.
  3812. Files in this other format are not human readable. To be easy to use
  3813. by programs it is a binary file. But the format is byte order
  3814. independent so translation files can be shared by systems of arbitrary
  3815. architecture (as long as they use the GNU C Library).
  3816. Details about the binary file format are not important to know since
  3817. these files are always created by the ‘gencat’ program. The sources of
  3818. the GNU C Library also provide the sources for the ‘gencat’ program and
  3819. so the interested reader can look through these source files to learn
  3820. about the file format.
  3821. 
  3822. File: libc.info, Node: The gencat program, Next: Common Usage, Prev: The message catalog files, Up: Message catalogs a la X/Open
  3823. 8.1.3 Generate Message Catalogs files
  3824. -------------------------------------
  3825. The ‘gencat’ program is specified in the X/Open standard and the GNU
  3826. implementation follows this specification and so processes all correctly
  3827. formed input files. Additionally some extension are implemented which
  3828. help to work in a more reasonable way with the ‘catgets’ functions.
  3829. The ‘gencat’ program can be invoked in two ways:
  3830. `gencat [OPTION ...] [OUTPUT-FILE [INPUT-FILE ...]]`
  3831. This is the interface defined in the X/Open standard. If no
  3832. INPUT-FILE parameter is given, input will be read from standard input.
  3833. Multiple input files will be read as if they were concatenated. If
  3834. OUTPUT-FILE is also missing, the output will be written to standard
  3835. output. To provide the interface one is used to from other programs a
  3836. second interface is provided.
  3837. `gencat [OPTION ...] -o OUTPUT-FILE [INPUT-FILE ...]`
  3838. The option ‘-o’ is used to specify the output file and all file
  3839. arguments are used as input files.
  3840. Beside this one can use ‘-’ or ‘/dev/stdin’ for INPUT-FILE to denote
  3841. the standard input. Corresponding one can use ‘-’ and ‘/dev/stdout’ for
  3842. OUTPUT-FILE to denote standard output. Using ‘-’ as a file name is
  3843. allowed in X/Open while using the device names is a GNU extension.
  3844. The ‘gencat’ program works by concatenating all input files and then
  3845. *merging* the resulting collection of message sets with a possibly
  3846. existing output file. This is done by removing all messages with
  3847. set/message number tuples matching any of the generated messages from
  3848. the output file and then adding all the new messages. To regenerate a
  3849. catalog file while ignoring the old contents therefore requires removing
  3850. the output file if it exists. If the output is written to standard
  3851. output no merging takes place.
  3852. The following table shows the options understood by the ‘gencat’
  3853. program. The X/Open standard does not specify any options for the
  3854. program so all of these are GNU extensions.
  3855. ‘-V’
  3856. ‘--version’
  3857. Print the version information and exit.
  3858. ‘-h’
  3859. ‘--help’
  3860. Print a usage message listing all available options, then exit
  3861. successfully.
  3862. ‘--new’
  3863. Do not merge the new messages from the input files with the old
  3864. content of the output file. The old content of the output file is
  3865. discarded.
  3866. ‘-H’
  3867. ‘--header=name’
  3868. This option is used to emit the symbolic names given to sets and
  3869. messages in the input files for use in the program. Details about
  3870. how to use this are given in the next section. The NAME parameter
  3871. to this option specifies the name of the output file. It will
  3872. contain a number of C preprocessor ‘#define’s to associate a name
  3873. with a number.
  3874. Please note that the generated file only contains the symbols from
  3875. the input files. If the output is merged with the previous content
  3876. of the output file the possibly existing symbols from the file(s)
  3877. which generated the old output files are not in the generated
  3878. header file.
  3879. 
  3880. File: libc.info, Node: Common Usage, Prev: The gencat program, Up: Message catalogs a la X/Open
  3881. 8.1.4 How to use the ‘catgets’ interface
  3882. ----------------------------------------
  3883. The ‘catgets’ functions can be used in two different ways. By following
  3884. slavishly the X/Open specs and not relying on the extension and by using
  3885. the GNU extensions. We will take a look at the former method first to
  3886. understand the benefits of extensions.
  3887. 8.1.4.1 Not using symbolic names
  3888. ................................
  3889. Since the X/Open format of the message catalog files does not allow
  3890. symbol names we have to work with numbers all the time. When we start
  3891. writing a program we have to replace all appearances of translatable
  3892. strings with something like
  3893. catgets (catdesc, set, msg, "string")
  3894. CATGETS is retrieved from a call to ‘catopen’ which is normally done
  3895. once at the program start. The ‘"string"’ is the string we want to
  3896. translate. The problems start with the set and message numbers.
  3897. In a bigger program several programmers usually work at the same time
  3898. on the program and so coordinating the number allocation is crucial.
  3899. Though no two different strings must be indexed by the same tuple of
  3900. numbers it is highly desirable to reuse the numbers for equal strings
  3901. with equal translations (please note that there might be strings which
  3902. are equal in one language but have different translations due to
  3903. difference contexts).
  3904. The allocation process can be relaxed a bit by different set numbers
  3905. for different parts of the program. So the number of developers who
  3906. have to coordinate the allocation can be reduced. But still lists must
  3907. be keep track of the allocation and errors can easily happen. These
  3908. errors cannot be discovered by the compiler or the ‘catgets’ functions.
  3909. Only the user of the program might see wrong messages printed. In the
  3910. worst cases the messages are so irritating that they cannot be
  3911. recognized as wrong. Think about the translations for ‘"true"’ and
  3912. ‘"false"’ being exchanged. This could result in a disaster.
  3913. 8.1.4.2 Using symbolic names
  3914. ............................
  3915. The problems mentioned in the last section derive from the fact that:
  3916. 1. the numbers are allocated once and due to the possibly frequent use
  3917. of them it is difficult to change a number later.
  3918. 2. the numbers do not allow guessing anything about the string and
  3919. therefore collisions can easily happen.
  3920. By constantly using symbolic names and by providing a method which
  3921. maps the string content to a symbolic name (however this will happen)
  3922. one can prevent both problems above. The cost of this is that the
  3923. programmer has to write a complete message catalog file while s/he is
  3924. writing the program itself.
  3925. This is necessary since the symbolic names must be mapped to numbers
  3926. before the program sources can be compiled. In the last section it was
  3927. described how to generate a header containing the mapping of the names.
  3928. E.g., for the example message file given in the last section we could
  3929. call the ‘gencat’ program as follows (assume ‘ex.msg’ contains the
  3930. sources).
  3931. gencat -H ex.h -o ex.cat ex.msg
  3932. This generates a header file with the following content:
  3933. #define SetTwoSet 0x2 /* ex.msg:8 */
  3934. #define SetOneSet 0x1 /* ex.msg:4 */
  3935. #define SetOnetwo 0x2 /* ex.msg:6 */
  3936. As can be seen the various symbols given in the source file are
  3937. mangled to generate unique identifiers and these identifiers get numbers
  3938. assigned. Reading the source file and knowing about the rules will
  3939. allow to predict the content of the header file (it is deterministic)
  3940. but this is not necessary. The ‘gencat’ program can take care for
  3941. everything. All the programmer has to do is to put the generated header
  3942. file in the dependency list of the source files of her/his project and
  3943. add a rule to regenerate the header if any of the input files change.
  3944. One word about the symbol mangling. Every symbol consists of two
  3945. parts: the name of the message set plus the name of the message or the
  3946. special string ‘Set’. So ‘SetOnetwo’ means this macro can be used to
  3947. access the translation with identifier ‘two’ in the message set
  3948. ‘SetOne’.
  3949. The other names denote the names of the message sets. The special
  3950. string ‘Set’ is used in the place of the message identifier.
  3951. If in the code the second string of the set ‘SetOne’ is used the C
  3952. code should look like this:
  3953. catgets (catdesc, SetOneSet, SetOnetwo,
  3954. " Message with ID \"two\", which gets the value 2 assigned")
  3955. Writing the function this way will allow to change the message number
  3956. and even the set number without requiring any change in the C source
  3957. code. (The text of the string is normally not the same; this is only
  3958. for this example.)
  3959. 8.1.4.3 How does to this allow to develop
  3960. .........................................
  3961. To illustrate the usual way to work with the symbolic version numbers
  3962. here is a little example. Assume we want to write the very complex and
  3963. famous greeting program. We start by writing the code as usual:
  3964. #include <stdio.h>
  3965. int
  3966. main (void)
  3967. {
  3968. printf ("Hello, world!\n");
  3969. return 0;
  3970. }
  3971. Now we want to internationalize the message and therefore replace the
  3972. message with whatever the user wants.
  3973. #include <nl_types.h>
  3974. #include <stdio.h>
  3975. #include "msgnrs.h"
  3976. int
  3977. main (void)
  3978. {
  3979. nl_catd catdesc = catopen ("hello.cat", NL_CAT_LOCALE);
  3980. printf (catgets (catdesc, SetMainSet, SetMainHello,
  3981. "Hello, world!\n"));
  3982. catclose (catdesc);
  3983. return 0;
  3984. }
  3985. We see how the catalog object is opened and the returned descriptor
  3986. used in the other function calls. It is not really necessary to check
  3987. for failure of any of the functions since even in these situations the
  3988. functions will behave reasonable. They simply will be return a
  3989. translation.
  3990. What remains unspecified here are the constants ‘SetMainSet’ and
  3991. ‘SetMainHello’. These are the symbolic names describing the message.
  3992. To get the actual definitions which match the information in the catalog
  3993. file we have to create the message catalog source file and process it
  3994. using the ‘gencat’ program.
  3995. $ Messages for the famous greeting program.
  3996. $quote "
  3997. $set Main
  3998. Hello "Hallo, Welt!\n"
  3999. Now we can start building the program (assume the message catalog
  4000. source file is named ‘hello.msg’ and the program source file ‘hello.c’):
  4001. % gencat -H msgnrs.h -o hello.cat hello.msg
  4002. % cat msgnrs.h
  4003. #define MainSet 0x1 /* hello.msg:4 */
  4004. #define MainHello 0x1 /* hello.msg:5 */
  4005. % gcc -o hello hello.c -I.
  4006. % cp hello.cat /usr/share/locale/de/LC_MESSAGES
  4007. % echo $LC_ALL
  4008. de
  4009. % ./hello
  4010. Hallo, Welt!
  4011. %
  4012. The call of the ‘gencat’ program creates the missing header file
  4013. ‘msgnrs.h’ as well as the message catalog binary. The former is used in
  4014. the compilation of ‘hello.c’ while the later is placed in a directory in
  4015. which the ‘catopen’ function will try to locate it. Please check the
  4016. ‘LC_ALL’ environment variable and the default path for ‘catopen’
  4017. presented in the description above.
  4018. 
  4019. File: libc.info, Node: The Uniforum approach, Prev: Message catalogs a la X/Open, Up: Message Translation
  4020. 8.2 The Uniforum approach to Message Translation
  4021. ================================================
  4022. Sun Microsystems tried to standardize a different approach to message
  4023. translation in the Uniforum group. There never was a real standard
  4024. defined but still the interface was used in Sun's operating systems.
  4025. Since this approach fits better in the development process of free
  4026. software it is also used throughout the GNU project and the GNU
  4027. ‘gettext’ package provides support for this outside the GNU C Library.
  4028. The code of the ‘libintl’ from GNU ‘gettext’ is the same as the code
  4029. in the GNU C Library. So the documentation in the GNU ‘gettext’ manual
  4030. is also valid for the functionality here. The following text will
  4031. describe the library functions in detail. But the numerous helper
  4032. programs are not described in this manual. Instead people should read
  4033. the GNU ‘gettext’ manual (*note GNU gettext utilities: (gettext)Top.).
  4034. We will only give a short overview.
  4035. Though the ‘catgets’ functions are available by default on more
  4036. systems the ‘gettext’ interface is at least as portable as the former.
  4037. The GNU ‘gettext’ package can be used wherever the functions are not
  4038. available.
  4039. * Menu:
  4040. * Message catalogs with gettext:: The ‘gettext’ family of functions.
  4041. * Helper programs for gettext:: Programs to handle message catalogs
  4042. for ‘gettext’.
  4043. 
  4044. File: libc.info, Node: Message catalogs with gettext, Next: Helper programs for gettext, Up: The Uniforum approach
  4045. 8.2.1 The ‘gettext’ family of functions
  4046. ---------------------------------------
  4047. The paradigms underlying the ‘gettext’ approach to message translations
  4048. is different from that of the ‘catgets’ functions the basic functionally
  4049. is equivalent. There are functions of the following categories:
  4050. * Menu:
  4051. * Translation with gettext:: What has to be done to translate a message.
  4052. * Locating gettext catalog:: How to determine which catalog to be used.
  4053. * Advanced gettext functions:: Additional functions for more complicated
  4054. situations.
  4055. * Charset conversion in gettext:: How to specify the output character set
  4056. ‘gettext’ uses.
  4057. * GUI program problems:: How to use ‘gettext’ in GUI programs.
  4058. * Using gettextized software:: The possibilities of the user to influence
  4059. the way ‘gettext’ works.
  4060. 
  4061. File: libc.info, Node: Translation with gettext, Next: Locating gettext catalog, Up: Message catalogs with gettext
  4062. 8.2.1.1 What has to be done to translate a message?
  4063. ...................................................
  4064. The ‘gettext’ functions have a very simple interface. The most basic
  4065. function just takes the string which shall be translated as the argument
  4066. and it returns the translation. This is fundamentally different from
  4067. the ‘catgets’ approach where an extra key is necessary and the original
  4068. string is only used for the error case.
  4069. If the string which has to be translated is the only argument this of
  4070. course means the string itself is the key. I.e., the translation will
  4071. be selected based on the original string. The message catalogs must
  4072. therefore contain the original strings plus one translation for any such
  4073. string. The task of the ‘gettext’ function is to compare the argument
  4074. string with the available strings in the catalog and return the
  4075. appropriate translation. Of course this process is optimized so that
  4076. this process is not more expensive than an access using an atomic key
  4077. like in ‘catgets’.
  4078. The ‘gettext’ approach has some advantages but also some
  4079. disadvantages. Please see the GNU ‘gettext’ manual for a detailed
  4080. discussion of the pros and cons.
  4081. All the definitions and declarations for ‘gettext’ can be found in
  4082. the ‘libintl.h’ header file. On systems where these functions are not
  4083. part of the C library they can be found in a separate library named
  4084. ‘libintl.a’ (or accordingly different for shared libraries).
  4085. -- Function: char * gettext (const char *MSGID)
  4086. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4087. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4088. The ‘gettext’ function searches the currently selected message
  4089. catalogs for a string which is equal to MSGID. If there is such a
  4090. string available it is returned. Otherwise the argument string
  4091. MSGID is returned.
  4092. Please note that although the return value is ‘char *’ the returned
  4093. string must not be changed. This broken type results from the
  4094. history of the function and does not reflect the way the function
  4095. should be used.
  4096. Please note that above we wrote "message catalogs" (plural). This
  4097. is a specialty of the GNU implementation of these functions and we
  4098. will say more about this when we talk about the ways message
  4099. catalogs are selected (*note Locating gettext catalog::).
  4100. The ‘gettext’ function does not modify the value of the global
  4101. ‘errno’ variable. This is necessary to make it possible to write
  4102. something like
  4103. printf (gettext ("Operation failed: %m\n"));
  4104. Here the ‘errno’ value is used in the ‘printf’ function while
  4105. processing the ‘%m’ format element and if the ‘gettext’ function
  4106. would change this value (it is called before ‘printf’ is called) we
  4107. would get a wrong message.
  4108. So there is no easy way to detect a missing message catalog besides
  4109. comparing the argument string with the result. But it is normally
  4110. the task of the user to react on missing catalogs. The program
  4111. cannot guess when a message catalog is really necessary since for a
  4112. user who speaks the language the program was developed in, the
  4113. message does not need any translation.
  4114. The remaining two functions to access the message catalog add some
  4115. functionality to select a message catalog which is not the default one.
  4116. This is important if parts of the program are developed independently.
  4117. Every part can have its own message catalog and all of them can be used
  4118. at the same time. The C library itself is an example: internally it
  4119. uses the ‘gettext’ functions but since it must not depend on a currently
  4120. selected default message catalog it must specify all ambiguous
  4121. information.
  4122. -- Function: char * dgettext (const char *DOMAINNAME, const char
  4123. *MSGID)
  4124. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4125. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4126. The ‘dgettext’ function acts just like the ‘gettext’ function. It
  4127. only takes an additional first argument DOMAINNAME which guides the
  4128. selection of the message catalogs which are searched for the
  4129. translation. If the DOMAINNAME parameter is the null pointer the
  4130. ‘dgettext’ function is exactly equivalent to ‘gettext’ since the
  4131. default value for the domain name is used.
  4132. As for ‘gettext’ the return value type is ‘char *’ which is an
  4133. anachronism. The returned string must never be modified.
  4134. -- Function: char * dcgettext (const char *DOMAINNAME, const char
  4135. *MSGID, int CATEGORY)
  4136. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4137. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4138. The ‘dcgettext’ adds another argument to those which ‘dgettext’
  4139. takes. This argument CATEGORY specifies the last piece of
  4140. information needed to localize the message catalog. I.e., the
  4141. domain name and the locale category exactly specify which message
  4142. catalog has to be used (relative to a given directory, see below).
  4143. The ‘dgettext’ function can be expressed in terms of ‘dcgettext’ by
  4144. using
  4145. dcgettext (domain, string, LC_MESSAGES)
  4146. instead of
  4147. dgettext (domain, string)
  4148. This also shows which values are expected for the third parameter.
  4149. One has to use the available selectors for the categories available
  4150. in ‘locale.h’. Normally the available values are ‘LC_CTYPE’,
  4151. ‘LC_COLLATE’, ‘LC_MESSAGES’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and
  4152. ‘LC_TIME’. Please note that ‘LC_ALL’ must not be used and even
  4153. though the names might suggest this, there is no relation to the
  4154. environment variable of this name.
  4155. The ‘dcgettext’ function is only implemented for compatibility with
  4156. other systems which have ‘gettext’ functions. There is not really
  4157. any situation where it is necessary (or useful) to use a different
  4158. value than ‘LC_MESSAGES’ for the CATEGORY parameter. We are
  4159. dealing with messages here and any other choice can only be
  4160. irritating.
  4161. As for ‘gettext’ the return value type is ‘char *’ which is an
  4162. anachronism. The returned string must never be modified.
  4163. When using the three functions above in a program it is a frequent
  4164. case that the MSGID argument is a constant string. So it is worthwhile
  4165. to optimize this case. Thinking shortly about this one will realize
  4166. that as long as no new message catalog is loaded the translation of a
  4167. message will not change. This optimization is actually implemented by
  4168. the ‘gettext’, ‘dgettext’ and ‘dcgettext’ functions.
  4169. 
  4170. File: libc.info, Node: Locating gettext catalog, Next: Advanced gettext functions, Prev: Translation with gettext, Up: Message catalogs with gettext
  4171. 8.2.1.2 How to determine which catalog to be used
  4172. .................................................
  4173. The functions to retrieve the translations for a given message have a
  4174. remarkable simple interface. But to provide the user of the program
  4175. still the opportunity to select exactly the translation s/he wants and
  4176. also to provide the programmer the possibility to influence the way to
  4177. locate the search for catalogs files there is a quite complicated
  4178. underlying mechanism which controls all this. The code is complicated
  4179. the use is easy.
  4180. Basically we have two different tasks to perform which can also be
  4181. performed by the ‘catgets’ functions:
  4182. 1. Locate the set of message catalogs. There are a number of files
  4183. for different languages which all belong to the package. Usually
  4184. they are all stored in the filesystem below a certain directory.
  4185. There can be arbitrarily many packages installed and they can
  4186. follow different guidelines for the placement of their files.
  4187. 2. Relative to the location specified by the package the actual
  4188. translation files must be searched, based on the wishes of the
  4189. user. I.e., for each language the user selects the program should
  4190. be able to locate the appropriate file.
  4191. This is the functionality required by the specifications for
  4192. ‘gettext’ and this is also what the ‘catgets’ functions are able to do.
  4193. But there are some problems unresolved:
  4194. • The language to be used can be specified in several different ways.
  4195. There is no generally accepted standard for this and the user
  4196. always expects the program to understand what s/he means. E.g., to
  4197. select the German translation one could write ‘de’, ‘german’, or
  4198. ‘deutsch’ and the program should always react the same.
  4199. • Sometimes the specification of the user is too detailed. If s/he,
  4200. e.g., specifies ‘de_DE.ISO-8859-1’ which means German, spoken in
  4201. Germany, coded using the ISO 8859-1 character set there is the
  4202. possibility that a message catalog matching this exactly is not
  4203. available. But there could be a catalog matching ‘de’ and if the
  4204. character set used on the machine is always ISO 8859-1 there is no
  4205. reason why this later message catalog should not be used. (We call
  4206. this “message inheritance”.)
  4207. • If a catalog for a wanted language is not available it is not
  4208. always the second best choice to fall back on the language of the
  4209. developer and simply not translate any message. Instead a user
  4210. might be better able to read the messages in another language and
  4211. so the user of the program should be able to define a precedence
  4212. order of languages.
  4213. We can divide the configuration actions in two parts: the one is
  4214. performed by the programmer, the other by the user. We will start with
  4215. the functions the programmer can use since the user configuration will
  4216. be based on this.
  4217. As the functions described in the last sections already mention
  4218. separate sets of messages can be selected by a “domain name”. This is a
  4219. simple string which should be unique for each program part that uses a
  4220. separate domain. It is possible to use in one program arbitrarily many
  4221. domains at the same time. E.g., the GNU C Library itself uses a domain
  4222. named ‘libc’ while the program using the C Library could use a domain
  4223. named ‘foo’. The important point is that at any time exactly one domain
  4224. is active. This is controlled with the following function.
  4225. -- Function: char * textdomain (const char *DOMAINNAME)
  4226. Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
  4227. *Note POSIX Safety Concepts::.
  4228. The ‘textdomain’ function sets the default domain, which is used in
  4229. all future ‘gettext’ calls, to DOMAINNAME. Please note that
  4230. ‘dgettext’ and ‘dcgettext’ calls are not influenced if the
  4231. DOMAINNAME parameter of these functions is not the null pointer.
  4232. Before the first call to ‘textdomain’ the default domain is
  4233. ‘messages’. This is the name specified in the specification of the
  4234. ‘gettext’ API. This name is as good as any other name. No program
  4235. should ever really use a domain with this name since this can only
  4236. lead to problems.
  4237. The function returns the value which is from now on taken as the
  4238. default domain. If the system went out of memory the returned
  4239. value is ‘NULL’ and the global variable ‘errno’ is set to ‘ENOMEM’.
  4240. Despite the return value type being ‘char *’ the return string must
  4241. not be changed. It is allocated internally by the ‘textdomain’
  4242. function.
  4243. If the DOMAINNAME parameter is the null pointer no new default
  4244. domain is set. Instead the currently selected default domain is
  4245. returned.
  4246. If the DOMAINNAME parameter is the empty string the default domain
  4247. is reset to its initial value, the domain with the name ‘messages’.
  4248. This possibility is questionable to use since the domain ‘messages’
  4249. really never should be used.
  4250. -- Function: char * bindtextdomain (const char *DOMAINNAME, const char
  4251. *DIRNAME)
  4252. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
  4253. POSIX Safety Concepts::.
  4254. The ‘bindtextdomain’ function can be used to specify the directory
  4255. which contains the message catalogs for domain DOMAINNAME for the
  4256. different languages. To be correct, this is the directory where
  4257. the hierarchy of directories is expected. Details are explained
  4258. below.
  4259. For the programmer it is important to note that the translations
  4260. which come with the program have to be placed in a directory
  4261. hierarchy starting at, say, ‘/foo/bar’. Then the program should
  4262. make a ‘bindtextdomain’ call to bind the domain for the current
  4263. program to this directory. So it is made sure the catalogs are
  4264. found. A correctly running program does not depend on the user
  4265. setting an environment variable.
  4266. The ‘bindtextdomain’ function can be used several times and if the
  4267. DOMAINNAME argument is different the previously bound domains will
  4268. not be overwritten.
  4269. If the program which wish to use ‘bindtextdomain’ at some point of
  4270. time use the ‘chdir’ function to change the current working
  4271. directory it is important that the DIRNAME strings ought to be an
  4272. absolute pathname. Otherwise the addressed directory might vary
  4273. with the time.
  4274. If the DIRNAME parameter is the null pointer ‘bindtextdomain’
  4275. returns the currently selected directory for the domain with the
  4276. name DOMAINNAME.
  4277. The ‘bindtextdomain’ function returns a pointer to a string
  4278. containing the name of the selected directory name. The string is
  4279. allocated internally in the function and must not be changed by the
  4280. user. If the system went out of core during the execution of
  4281. ‘bindtextdomain’ the return value is ‘NULL’ and the global variable
  4282. ‘errno’ is set accordingly.
  4283. 
  4284. File: libc.info, Node: Advanced gettext functions, Next: Charset conversion in gettext, Prev: Locating gettext catalog, Up: Message catalogs with gettext
  4285. 8.2.1.3 Additional functions for more complicated situations
  4286. ............................................................
  4287. The functions of the ‘gettext’ family described so far (and all the
  4288. ‘catgets’ functions as well) have one problem in the real world which
  4289. has been neglected completely in all existing approaches. What is meant
  4290. here is the handling of plural forms.
  4291. Looking through Unix source code before the time anybody thought
  4292. about internationalization (and, sadly, even afterwards) one can often
  4293. find code similar to the following:
  4294. printf ("%d file%s deleted", n, n == 1 ? "" : "s");
  4295. After the first complaints from people internationalizing the code
  4296. people either completely avoided formulations like this or used strings
  4297. like ‘"file(s)"’. Both look unnatural and should be avoided. First
  4298. tries to solve the problem correctly looked like this:
  4299. if (n == 1)
  4300. printf ("%d file deleted", n);
  4301. else
  4302. printf ("%d files deleted", n);
  4303. But this does not solve the problem. It helps languages where the
  4304. plural form of a noun is not simply constructed by adding an 's' but
  4305. that is all. Once again people fell into the trap of believing the
  4306. rules their language uses are universal. But the handling of plural
  4307. forms differs widely between the language families. There are two
  4308. things we can differ between (and even inside language families);
  4309. • The form how plural forms are build differs. This is a problem
  4310. with language which have many irregularities. German, for
  4311. instance, is a drastic case. Though English and German are part of
  4312. the same language family (Germanic), the almost regular forming of
  4313. plural noun forms (appending an 's') is hardly found in German.
  4314. • The number of plural forms differ. This is somewhat surprising for
  4315. those who only have experiences with Romanic and Germanic languages
  4316. since here the number is the same (there are two).
  4317. But other language families have only one form or many forms. More
  4318. information on this in an extra section.
  4319. The consequence of this is that application writers should not try to
  4320. solve the problem in their code. This would be localization since it is
  4321. only usable for certain, hardcoded language environments. Instead the
  4322. extended ‘gettext’ interface should be used.
  4323. These extra functions are taking instead of the one key string two
  4324. strings and a numerical argument. The idea behind this is that using
  4325. the numerical argument and the first string as a key, the implementation
  4326. can select using rules specified by the translator the right plural
  4327. form. The two string arguments then will be used to provide a return
  4328. value in case no message catalog is found (similar to the normal
  4329. ‘gettext’ behavior). In this case the rules for Germanic language are
  4330. used and it is assumed that the first string argument is the singular
  4331. form, the second the plural form.
  4332. This has the consequence that programs without language catalogs can
  4333. display the correct strings only if the program itself is written using
  4334. a Germanic language. This is a limitation but since the GNU C Library
  4335. (as well as the GNU ‘gettext’ package) is written as part of the GNU
  4336. package and the coding standards for the GNU project require programs to
  4337. be written in English, this solution nevertheless fulfills its purpose.
  4338. -- Function: char * ngettext (const char *MSGID1, const char *MSGID2,
  4339. unsigned long int N)
  4340. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4341. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4342. The ‘ngettext’ function is similar to the ‘gettext’ function as it
  4343. finds the message catalogs in the same way. But it takes two extra
  4344. arguments. The MSGID1 parameter must contain the singular form of
  4345. the string to be converted. It is also used as the key for the
  4346. search in the catalog. The MSGID2 parameter is the plural form.
  4347. The parameter N is used to determine the plural form. If no
  4348. message catalog is found MSGID1 is returned if ‘n == 1’, otherwise
  4349. ‘msgid2’.
  4350. An example for the use of this function is:
  4351. printf (ngettext ("%d file removed", "%d files removed", n), n);
  4352. Please note that the numeric value N has to be passed to the
  4353. ‘printf’ function as well. It is not sufficient to pass it only to
  4354. ‘ngettext’.
  4355. -- Function: char * dngettext (const char *DOMAIN, const char *MSGID1,
  4356. const char *MSGID2, unsigned long int N)
  4357. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4358. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4359. The ‘dngettext’ is similar to the ‘dgettext’ function in the way
  4360. the message catalog is selected. The difference is that it takes
  4361. two extra parameters to provide the correct plural form. These two
  4362. parameters are handled in the same way ‘ngettext’ handles them.
  4363. -- Function: char * dcngettext (const char *DOMAIN, const char *MSGID1,
  4364. const char *MSGID2, unsigned long int N, int CATEGORY)
  4365. Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
  4366. AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
  4367. The ‘dcngettext’ is similar to the ‘dcgettext’ function in the way
  4368. the message catalog is selected. The difference is that it takes
  4369. two extra parameters to provide the correct plural form. These two
  4370. parameters are handled in the same way ‘ngettext’ handles them.
  4371. The problem of plural forms
  4372. ...........................
  4373. A description of the problem can be found at the beginning of the last
  4374. section. Now there is the question how to solve it. Without the input
  4375. of linguists (which was not available) it was not possible to determine
  4376. whether there are only a few different forms in which plural forms are
  4377. formed or whether the number can increase with every new supported
  4378. language.
  4379. Therefore the solution implemented is to allow the translator to
  4380. specify the rules of how to select the plural form. Since the formula
  4381. varies with every language this is the only viable solution except for
  4382. hardcoding the information in the code (which still would require the
  4383. possibility of extensions to not prevent the use of new languages). The
  4384. details are explained in the GNU ‘gettext’ manual. Here only a bit of
  4385. information is provided.
  4386. The information about the plural form selection has to be stored in
  4387. the header entry (the one with the empty ‘msgid’ string). It looks like
  4388. this:
  4389. Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;
  4390. The ‘nplurals’ value must be a decimal number which specifies how
  4391. many different plural forms exist for this language. The string
  4392. following ‘plural’ is an expression using the C language syntax.
  4393. Exceptions are that no negative numbers are allowed, numbers must be
  4394. decimal, and the only variable allowed is ‘n’. This expression will be
  4395. evaluated whenever one of the functions ‘ngettext’, ‘dngettext’, or
  4396. ‘dcngettext’ is called. The numeric value passed to these functions is
  4397. then substituted for all uses of the variable ‘n’ in the expression.
  4398. The resulting value then must be greater or equal to zero and smaller
  4399. than the value given as the value of ‘nplurals’.
  4400. The following rules are known at this point. The language with families
  4401. are listed. But this does not necessarily mean the information can be
  4402. generalized for the whole family (as can be easily seen in the table
  4403. below).(1)
  4404. Only one form:
  4405. Some languages only require one single form. There is no
  4406. distinction between the singular and plural form. An appropriate
  4407. header entry would look like this:
  4408. Plural-Forms: nplurals=1; plural=0;
  4409. Languages with this property include:
  4410. Finno-Ugric family
  4411. Hungarian
  4412. Asian family
  4413. Japanese, Korean
  4414. Turkic/Altaic family
  4415. Turkish
  4416. Two forms, singular used for one only
  4417. This is the form used in most existing programs since it is what
  4418. English uses. A header entry would look like this:
  4419. Plural-Forms: nplurals=2; plural=n != 1;
  4420. (Note: this uses the feature of C expressions that boolean
  4421. expressions have to value zero or one.)
  4422. Languages with this property include:
  4423. Germanic family
  4424. Danish, Dutch, English, German, Norwegian, Swedish
  4425. Finno-Ugric family
  4426. Estonian, Finnish
  4427. Latin/Greek family
  4428. Greek
  4429. Semitic family
  4430. Hebrew
  4431. Romance family
  4432. Italian, Portuguese, Spanish
  4433. Artificial
  4434. Esperanto
  4435. Two forms, singular used for zero and one
  4436. Exceptional case in the language family. The header entry would
  4437. be:
  4438. Plural-Forms: nplurals=2; plural=n>1;
  4439. Languages with this property include:
  4440. Romanic family
  4441. French, Brazilian Portuguese
  4442. Three forms, special case for zero
  4443. The header entry would be:
  4444. Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;
  4445. Languages with this property include:
  4446. Baltic family
  4447. Latvian
  4448. Three forms, special cases for one and two
  4449. The header entry would be:
  4450. Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;
  4451. Languages with this property include:
  4452. Celtic
  4453. Gaeilge (Irish)
  4454. Three forms, special case for numbers ending in 1[2-9]
  4455. The header entry would look like this:
  4456. Plural-Forms: nplurals=3; \
  4457. plural=n%10==1 && n%100!=11 ? 0 : \
  4458. n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;
  4459. Languages with this property include:
  4460. Baltic family
  4461. Lithuanian
  4462. Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4]
  4463. The header entry would look like this:
  4464. Plural-Forms: nplurals=3; \
  4465. plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%10>3 ? 2 : 1;
  4466. Languages with this property include:
  4467. Slavic family
  4468. Croatian, Czech, Russian, Ukrainian
  4469. Three forms, special cases for 1 and 2, 3, 4
  4470. The header entry would look like this:
  4471. Plural-Forms: nplurals=3; \
  4472. plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;
  4473. Languages with this property include:
  4474. Slavic family
  4475. Slovak
  4476. Three forms, special case for one and some numbers ending in 2, 3, or 4
  4477. The header entry would look like this:
  4478. Plural-Forms: nplurals=3; \
  4479. plural=n==1 ? 0 : \
  4480. n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
  4481. Languages with this property include:
  4482. Slavic family
  4483. Polish
  4484. Four forms, special case for one and all numbers ending in 02, 03, or 04
  4485. The header entry would look like this:
  4486. Plural-Forms: nplurals=4; \
  4487. plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;
  4488. Languages with this property include:
  4489. Slavic family
  4490. Slovenian
  4491. ---------- Footnotes ----------
  4492. (1) Additions are welcome. Send appropriate information to
  4493. <libc-alpha@sourceware.org>.
  4494. 
  4495. File: libc.info, Node: Charset conversion in gettext, Next: GUI program problems, Prev: Advanced gettext functions, Up: Message catalogs with gettext
  4496. 8.2.1.4 How to specify the output character set ‘gettext’ uses
  4497. ..............................................................
  4498. ‘gettext’ not only looks up a translation in a message catalog, it also
  4499. converts the translation on the fly to the desired output character set.
  4500. This is useful if the user is working in a different character set than
  4501. the translator who created the message catalog, because it avoids
  4502. distributing variants of message catalogs which differ only in the
  4503. character set.
  4504. The output character set is, by default, the value of ‘nl_langinfo
  4505. (CODESET)’, which depends on the ‘LC_CTYPE’ part of the current locale.
  4506. But programs which store strings in a locale independent way (e.g.
  4507. UTF-8) can request that ‘gettext’ and related functions return the
  4508. translations in that encoding, by use of the ‘bind_textdomain_codeset’
  4509. function.
  4510. Note that the MSGID argument to ‘gettext’ is not subject to character
  4511. set conversion. Also, when ‘gettext’ does not find a translation for
  4512. MSGID, it returns MSGID unchanged - independently of the current output
  4513. character set. It is therefore recommended that all MSGIDs be US-ASCII
  4514. strings.
  4515. -- Function: char * bind_textdomain_codeset (const char *DOMAINNAME,
  4516. const char *CODESET)
  4517. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
  4518. POSIX Safety Concepts::.
  4519. The ‘bind_textdomain_codeset’ function can be used to specify the
  4520. output character set for message catalogs for domain DOMAINNAME.
  4521. The CODESET argument must be a valid codeset name which can be used
  4522. for the ‘iconv_open’ function, or a null pointer.
  4523. If the CODESET parameter is the null pointer,
  4524. ‘bind_textdomain_codeset’ returns the currently selected codeset
  4525. for the domain with the name DOMAINNAME. It returns ‘NULL’ if no
  4526. codeset has yet been selected.
  4527. The ‘bind_textdomain_codeset’ function can be used several times.
  4528. If used multiple times with the same DOMAINNAME argument, the later
  4529. call overrides the settings made by the earlier one.
  4530. The ‘bind_textdomain_codeset’ function returns a pointer to a
  4531. string containing the name of the selected codeset. The string is
  4532. allocated internally in the function and must not be changed by the
  4533. user. If the system went out of core during the execution of
  4534. ‘bind_textdomain_codeset’, the return value is ‘NULL’ and the
  4535. global variable ‘errno’ is set accordingly.
  4536. 
  4537. File: libc.info, Node: GUI program problems, Next: Using gettextized software, Prev: Charset conversion in gettext, Up: Message catalogs with gettext
  4538. 8.2.1.5 How to use ‘gettext’ in GUI programs
  4539. ............................................
  4540. One place where the ‘gettext’ functions, if used normally, have big
  4541. problems is within programs with graphical user interfaces (GUIs). The
  4542. problem is that many of the strings which have to be translated are very
  4543. short. They have to appear in pull-down menus which restricts the
  4544. length. But strings which are not containing entire sentences or at
  4545. least large fragments of a sentence may appear in more than one
  4546. situation in the program but might have different translations. This is
  4547. especially true for the one-word strings which are frequently used in
  4548. GUI programs.
  4549. As a consequence many people say that the ‘gettext’ approach is wrong
  4550. and instead ‘catgets’ should be used which indeed does not have this
  4551. problem. But there is a very simple and powerful method to handle these
  4552. kind of problems with the ‘gettext’ functions.
  4553. As an example consider the following fictional situation. A GUI program
  4554. has a menu bar with the following entries:
  4555. +------------+------------+--------------------------------------+
  4556. | File | Printer | |
  4557. +------------+------------+--------------------------------------+
  4558. | Open | | Select |
  4559. | New | | Open |
  4560. +----------+ | Connect |
  4561. +----------+
  4562. To have the strings ‘File’, ‘Printer’, ‘Open’, ‘New’, ‘Select’, and
  4563. ‘Connect’ translated there has to be at some point in the code a call to
  4564. a function of the ‘gettext’ family. But in two places the string passed
  4565. into the function would be ‘Open’. The translations might not be the
  4566. same and therefore we are in the dilemma described above.
  4567. One solution to this problem is to artificially extend the strings to
  4568. make them unambiguous. But what would the program do if no translation
  4569. is available? The extended string is not what should be printed. So we
  4570. should use a slightly modified version of the functions.
  4571. To extend the strings a uniform method should be used. E.g., in the
  4572. example above, the strings could be chosen as
  4573. Menu|File
  4574. Menu|Printer
  4575. Menu|File|Open
  4576. Menu|File|New
  4577. Menu|Printer|Select
  4578. Menu|Printer|Open
  4579. Menu|Printer|Connect
  4580. Now all the strings are different and if now instead of ‘gettext’ the
  4581. following little wrapper function is used, everything works just fine:
  4582. char *
  4583. sgettext (const char *msgid)
  4584. {
  4585. char *msgval = gettext (msgid);
  4586. if (msgval == msgid)
  4587. msgval = strrchr (msgid, '|') + 1;
  4588. return msgval;
  4589. }
  4590. What this little function does is to recognize the case when no
  4591. translation is available. This can be done very efficiently by a
  4592. pointer comparison since the return value is the input value. If there
  4593. is no translation we know that the input string is in the format we used
  4594. for the Menu entries and therefore contains a ‘|’ character. We simply
  4595. search for the last occurrence of this character and return a pointer to
  4596. the character following it. That's it!
  4597. If one now consistently uses the extended string form and replaces
  4598. the ‘gettext’ calls with calls to ‘sgettext’ (this is normally limited
  4599. to very few places in the GUI implementation) then it is possible to
  4600. produce a program which can be internationalized.
  4601. With advanced compilers (such as GNU C) one can write the ‘sgettext’
  4602. functions as an inline function or as a macro like this:
  4603. #define sgettext(msgid) \
  4604. ({ const char *__msgid = (msgid); \
  4605. char *__msgstr = gettext (__msgid); \
  4606. if (__msgval == __msgid) \
  4607. __msgval = strrchr (__msgid, '|') + 1; \
  4608. __msgval; })
  4609. The other ‘gettext’ functions (‘dgettext’, ‘dcgettext’ and the
  4610. ‘ngettext’ equivalents) can and should have corresponding functions as
  4611. well which look almost identical, except for the parameters and the call
  4612. to the underlying function.
  4613. Now there is of course the question why such functions do not exist
  4614. in the GNU C Library? There are two parts of the answer to this
  4615. question.
  4616. • They are easy to write and therefore can be provided by the project
  4617. they are used in. This is not an answer by itself and must be seen
  4618. together with the second part which is:
  4619. • There is no way the C library can contain a version which can work
  4620. everywhere. The problem is the selection of the character to
  4621. separate the prefix from the actual string in the extended string.
  4622. The examples above used ‘|’ which is a quite good choice because it
  4623. resembles a notation frequently used in this context and it also is
  4624. a character not often used in message strings.
  4625. But what if the character is used in message strings. Or if the
  4626. chose character is not available in the character set on the
  4627. machine one compiles (e.g., ‘|’ is not required to exist for ISO C;
  4628. this is why the ‘iso646.h’ file exists in ISO C programming
  4629. environments).
  4630. There is only one more comment to make left. The wrapper function
  4631. above requires that the translations strings are not extended
  4632. themselves. This is only logical. There is no need to disambiguate the
  4633. strings (since they are never used as keys for a search) and one also
  4634. saves quite some memory and disk space by doing this.
  4635. 
  4636. File: libc.info, Node: Using gettextized software, Prev: GUI program problems, Up: Message catalogs with gettext
  4637. 8.2.1.6 User influence on ‘gettext’
  4638. ...................................
  4639. The last sections described what the programmer can do to
  4640. internationalize the messages of the program. But it is finally up to
  4641. the user to select the message s/he wants to see. S/He must understand
  4642. them.
  4643. The POSIX locale model uses the environment variables ‘LC_COLLATE’,
  4644. ‘LC_CTYPE’, ‘LC_MESSAGES’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and ‘LC_TIME’ to
  4645. select the locale which is to be used. This way the user can influence
  4646. lots of functions. As we mentioned above, the ‘gettext’ functions also
  4647. take advantage of this.
  4648. To understand how this happens it is necessary to take a look at the
  4649. various components of the filename which gets computed to locate a
  4650. message catalog. It is composed as follows:
  4651. DIR_NAME/LOCALE/LC_CATEGORY/DOMAIN_NAME.mo
  4652. The default value for DIR_NAME is system specific. It is computed
  4653. from the value given as the prefix while configuring the C library.
  4654. This value normally is ‘/usr’ or ‘/’. For the former the complete
  4655. DIR_NAME is:
  4656. /usr/share/locale
  4657. We can use ‘/usr/share’ since the ‘.mo’ files containing the message
  4658. catalogs are system independent, so all systems can use the same files.
  4659. If the program executed the ‘bindtextdomain’ function for the message
  4660. domain that is currently handled, the ‘dir_name’ component is exactly
  4661. the value which was given to the function as the second parameter.
  4662. I.e., ‘bindtextdomain’ allows overwriting the only system dependent and
  4663. fixed value to make it possible to address files anywhere in the
  4664. filesystem.
  4665. The CATEGORY is the name of the locale category which was selected in
  4666. the program code. For ‘gettext’ and ‘dgettext’ this is always
  4667. ‘LC_MESSAGES’, for ‘dcgettext’ this is selected by the value of the
  4668. third parameter. As said above it should be avoided to ever use a
  4669. category other than ‘LC_MESSAGES’.
  4670. The LOCALE component is computed based on the category used. Just
  4671. like for the ‘setlocale’ function here comes the user selection into the
  4672. play. Some environment variables are examined in a fixed order and the
  4673. first environment variable set determines the return value of the lookup
  4674. process. In detail, for the category ‘LC_xxx’ the following variables
  4675. in this order are examined:
  4676. ‘LANGUAGE’
  4677. ‘LC_ALL’
  4678. ‘LC_xxx’
  4679. ‘LANG’
  4680. This looks very familiar. With the exception of the ‘LANGUAGE’
  4681. environment variable this is exactly the lookup order the ‘setlocale’
  4682. function uses. But why introduce the ‘LANGUAGE’ variable?
  4683. The reason is that the syntax of the values these variables can have
  4684. is different to what is expected by the ‘setlocale’ function. If we
  4685. would set ‘LC_ALL’ to a value following the extended syntax that would
  4686. mean the ‘setlocale’ function will never be able to use the value of
  4687. this variable as well. An additional variable removes this problem plus
  4688. we can select the language independently of the locale setting which
  4689. sometimes is useful.
  4690. While for the ‘LC_xxx’ variables the value should consist of exactly
  4691. one specification of a locale the ‘LANGUAGE’ variable's value can
  4692. consist of a colon separated list of locale names. The attentive reader
  4693. will realize that this is the way we manage to implement one of our
  4694. additional demands above: we want to be able to specify an ordered list
  4695. of languages.
  4696. Back to the constructed filename we have only one component missing.
  4697. The DOMAIN_NAME part is the name which was either registered using the
  4698. ‘textdomain’ function or which was given to ‘dgettext’ or ‘dcgettext’ as
  4699. the first parameter. Now it becomes obvious that a good choice for the
  4700. domain name in the program code is a string which is closely related to
  4701. the program/package name. E.g., for the GNU C Library the domain name
  4702. is ‘libc’.
  4703. A limited piece of example code should show how the program is supposed
  4704. to work:
  4705. {
  4706. setlocale (LC_ALL, "");
  4707. textdomain ("test-package");
  4708. bindtextdomain ("test-package", "/usr/local/share/locale");
  4709. puts (gettext ("Hello, world!"));
  4710. }
  4711. At the program start the default domain is ‘messages’, and the
  4712. default locale is "C". The ‘setlocale’ call sets the locale according to
  4713. the user's environment variables; remember that correct functioning of
  4714. ‘gettext’ relies on the correct setting of the ‘LC_MESSAGES’ locale (for
  4715. looking up the message catalog) and of the ‘LC_CTYPE’ locale (for the
  4716. character set conversion). The ‘textdomain’ call changes the default
  4717. domain to ‘test-package’. The ‘bindtextdomain’ call specifies that the
  4718. message catalogs for the domain ‘test-package’ can be found below the
  4719. directory ‘/usr/local/share/locale’.
  4720. If the user sets in her/his environment the variable ‘LANGUAGE’ to
  4721. ‘de’ the ‘gettext’ function will try to use the translations from the
  4722. file
  4723. /usr/local/share/locale/de/LC_MESSAGES/test-package.mo
  4724. From the above descriptions it should be clear which component of
  4725. this filename is determined by which source.
  4726. In the above example we assumed the ‘LANGUAGE’ environment variable
  4727. to be ‘de’. This might be an appropriate selection but what happens if
  4728. the user wants to use ‘LC_ALL’ because of the wider usability and here
  4729. the required value is ‘de_DE.ISO-8859-1’? We already mentioned above
  4730. that a situation like this is not infrequent. E.g., a person might
  4731. prefer reading a dialect and if this is not available fall back on the
  4732. standard language.
  4733. The ‘gettext’ functions know about situations like this and can
  4734. handle them gracefully. The functions recognize the format of the value
  4735. of the environment variable. It can split the value is different pieces
  4736. and by leaving out the only or the other part it can construct new
  4737. values. This happens of course in a predictable way. To understand
  4738. this one must know the format of the environment variable value. There
  4739. is one more or less standardized form, originally from the X/Open
  4740. specification:
  4741. ‘language[_territory[.codeset]][@modifier]’
  4742. Less specific locale names will be stripped in the order of the
  4743. following list:
  4744. 1. ‘codeset’
  4745. 2. ‘normalized codeset’
  4746. 3. ‘territory’
  4747. 4. ‘modifier’
  4748. The ‘language’ field will never be dropped for obvious reasons.
  4749. The only new thing is the ‘normalized codeset’ entry. This is
  4750. another goodie which is introduced to help reduce the chaos which
  4751. derives from the inability of people to standardize the names of
  4752. character sets. Instead of ISO-8859-1 one can often see 8859-1, 88591,
  4753. iso8859-1, or iso_8859-1. The ‘normalized codeset’ value is generated
  4754. from the user-provided character set name by applying the following
  4755. rules:
  4756. 1. Remove all characters besides numbers and letters.
  4757. 2. Fold letters to lowercase.
  4758. 3. If the same only contains digits prepend the string ‘"iso"’.
  4759. So all of the above names will be normalized to ‘iso88591’. This allows
  4760. the program user much more freedom in choosing the locale name.
  4761. Even this extended functionality still does not help to solve the
  4762. problem that completely different names can be used to denote the same
  4763. locale (e.g., ‘de’ and ‘german’). To be of help in this situation the
  4764. locale implementation and also the ‘gettext’ functions know about
  4765. aliases.
  4766. The file ‘/usr/share/locale/locale.alias’ (replace ‘/usr’ with
  4767. whatever prefix you used for configuring the C library) contains a
  4768. mapping of alternative names to more regular names. The system manager
  4769. is free to add new entries to fill her/his own needs. The selected
  4770. locale from the environment is compared with the entries in the first
  4771. column of this file ignoring the case. If they match, the value of the
  4772. second column is used instead for the further handling.
  4773. In the description of the format of the environment variables we
  4774. already mentioned the character set as a factor in the selection of the
  4775. message catalog. In fact, only catalogs which contain text written
  4776. using the character set of the system/program can be used (directly;
  4777. there will come a solution for this some day). This means for the user
  4778. that s/he will always have to take care of this. If in the collection
  4779. of the message catalogs there are files for the same language but coded
  4780. using different character sets the user has to be careful.
  4781. 
  4782. File: libc.info, Node: Helper programs for gettext, Prev: Message catalogs with gettext, Up: The Uniforum approach
  4783. 8.2.2 Programs to handle message catalogs for ‘gettext’
  4784. -------------------------------------------------------
  4785. The GNU C Library does not contain the source code for the programs to
  4786. handle message catalogs for the ‘gettext’ functions. As part of the GNU
  4787. project the GNU gettext package contains everything the developer needs.
  4788. The functionality provided by the tools in this package by far exceeds
  4789. the abilities of the ‘gencat’ program described above for the ‘catgets’
  4790. functions.
  4791. There is a program ‘msgfmt’ which is the equivalent program to the
  4792. ‘gencat’ program. It generates from the human-readable and -editable
  4793. form of the message catalog a binary file which can be used by the
  4794. ‘gettext’ functions. But there are several more programs available.
  4795. The ‘xgettext’ program can be used to automatically extract the
  4796. translatable messages from a source file. I.e., the programmer need not
  4797. take care of the translations and the list of messages which have to be
  4798. translated. S/He will simply wrap the translatable string in calls to
  4799. ‘gettext’ et.al and the rest will be done by ‘xgettext’. This program
  4800. has a lot of options which help to customize the output or help to
  4801. understand the input better.
  4802. Other programs help to manage the development cycle when new messages
  4803. appear in the source files or when a new translation of the messages
  4804. appears. Here it should only be noted that using all the tools in GNU
  4805. gettext it is possible to _completely_ automate the handling of message
  4806. catalogs. Besides marking the translatable strings in the source code
  4807. and generating the translations the developers do not have anything to
  4808. do themselves.
  4809. 
  4810. File: libc.info, Node: Searching and Sorting, Next: Pattern Matching, Prev: Message Translation, Up: Top
  4811. 9 Searching and Sorting
  4812. ***********************
  4813. This chapter describes functions for searching and sorting arrays of
  4814. arbitrary objects. You pass the appropriate comparison function to be
  4815. applied as an argument, along with the size of the objects in the array
  4816. and the total number of elements.
  4817. * Menu:
  4818. * Comparison Functions:: Defining how to compare two objects.
  4819. Since the sort and search facilities
  4820. are general, you have to specify the
  4821. ordering.
  4822. * Array Search Function:: The ‘bsearch’ function.
  4823. * Array Sort Function:: The ‘qsort’ function.
  4824. * Search/Sort Example:: An example program.
  4825. * Hash Search Function:: The ‘hsearch’ function.
  4826. * Tree Search Function:: The ‘tsearch’ function.
  4827. 
  4828. File: libc.info, Node: Comparison Functions, Next: Array Search Function, Up: Searching and Sorting
  4829. 9.1 Defining the Comparison Function
  4830. ====================================
  4831. In order to use the sorted array library functions, you have to describe
  4832. how to compare the elements of the array.
  4833. To do this, you supply a comparison function to compare two elements
  4834. of the array. The library will call this function, passing as arguments
  4835. pointers to two array elements to be compared. Your comparison function
  4836. should return a value the way ‘strcmp’ (*note String/Array Comparison::)
  4837. does: negative if the first argument is "less" than the second, zero if
  4838. they are "equal", and positive if the first argument is "greater".
  4839. Here is an example of a comparison function which works with an array
  4840. of numbers of type ‘long int’:
  4841. int
  4842. compare_long_ints (const void *a, const void *b)
  4843. {
  4844. const long int *la = a;
  4845. const long int *lb = b;
  4846. return (*la > *lb) - (*la < *lb);
  4847. }
  4848. (The code would have to be more complicated for an array of ‘double’,
  4849. to handle NaNs correctly.)
  4850. The header file ‘stdlib.h’ defines a name for the data type of
  4851. comparison functions. This type is a GNU extension.
  4852. int comparison_fn_t (const void *, const void *);
  4853. 
  4854. File: libc.info, Node: Array Search Function, Next: Array Sort Function, Prev: Comparison Functions, Up: Searching and Sorting
  4855. 9.2 Array Search Function
  4856. =========================
  4857. Generally searching for a specific element in an array means that
  4858. potentially all elements must be checked. The GNU C Library contains
  4859. functions to perform linear search. The prototypes for the following
  4860. two functions can be found in ‘search.h’.
  4861. -- Function: void * lfind (const void *KEY, const void *BASE, size_t
  4862. *NMEMB, size_t SIZE, comparison_fn_t COMPAR)
  4863. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4864. Concepts::.
  4865. The ‘lfind’ function searches in the array with ‘*NMEMB’ elements
  4866. of SIZE bytes pointed to by BASE for an element which matches the
  4867. one pointed to by KEY. The function pointed to by COMPAR is used
  4868. to decide whether two elements match.
  4869. The return value is a pointer to the matching element in the array
  4870. starting at BASE if it is found. If no matching element is
  4871. available ‘NULL’ is returned.
  4872. The mean runtime of this function is proportional to ‘*NMEMB/2’,
  4873. assuming random elements of the array are searched for. This
  4874. function should be used only if elements often get added to or
  4875. deleted from the array in which case it might not be useful to sort
  4876. the array before searching.
  4877. -- Function: void * lsearch (const void *KEY, void *BASE, size_t
  4878. *NMEMB, size_t SIZE, comparison_fn_t COMPAR)
  4879. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4880. Concepts::.
  4881. The ‘lsearch’ function is similar to the ‘lfind’ function. It
  4882. searches the given array for an element and returns it if found.
  4883. The difference is that if no matching element is found the
  4884. ‘lsearch’ function adds the object pointed to by KEY (with a size
  4885. of SIZE bytes) at the end of the array and it increments the value
  4886. of ‘*NMEMB’ to reflect this addition.
  4887. This means for the caller that if it is not sure that the array
  4888. contains the element one is searching for the memory allocated for
  4889. the array starting at BASE must have room for at least SIZE more
  4890. bytes. If one is sure the element is in the array it is better to
  4891. use ‘lfind’ so having more room in the array is always necessary
  4892. when calling ‘lsearch’.
  4893. To search a sorted or partially sorted array for an element matching
  4894. the key, use the ‘bsearch’ function. The prototype for this function is
  4895. in the header file ‘stdlib.h’.
  4896. -- Function: void * bsearch (const void *KEY, const void *ARRAY, size_t
  4897. COUNT, size_t SIZE, comparison_fn_t COMPARE)
  4898. Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
  4899. Concepts::.
  4900. The ‘bsearch’ function searches ARRAY for an element that is
  4901. equivalent to KEY. The array contains COUNT elements, each of
  4902. which is of size SIZE bytes.
  4903. The COMPARE function is used to perform the comparison. This
  4904. function is called with arguments that point to the key and to an
  4905. array element, in that order, and should return an integer less
  4906. than, equal to, or greater than zero corresponding to whether the
  4907. key is considered less than, equal to, or greater than the array
  4908. element. The function should not alter the array's contents, and
  4909. the same array element should always compare the same way with the
  4910. key.
  4911. Although the array need not be completely sorted, it should be
  4912. partially sorted with respect to KEY. That is, the array should
  4913. begin with elements that compare less than KEY, followed by
  4914. elements that compare equal to KEY, and ending with elements that
  4915. compare greater than KEY. Any or all of these element sequences
  4916. can be empty.
  4917. The return value is a pointer to a matching array element, or a
  4918. null pointer if no match is found. If the array contains more than
  4919. one element that matches, the one that is returned is unspecified.
  4920. This function derives its name from the fact that it is implemented
  4921. using the binary search algorithm.
  4922. In ISO C23 and later, this function is qualifier-generic: that is,
  4923. it is also implemented as a function-like macro, and when the macro
  4924. is used and ARRAY has a type that is a pointer to a
  4925. ‘const’-qualified object type, ‘bsearch’ returns ‘const void *’.
  4926. As an obsolescent feature, if the macro is suppressed the external
  4927. function returns ‘void *’ regardless.
  4928. 
  4929. File: libc.info, Node: Array Sort Function, Next: Search/Sort Example, Prev: Array Search Function, Up: Searching and Sorting
  4930. 9.3 Array Sort Function
  4931. =======================
  4932. To sort an array using an arbitrary comparison function, use the ‘qsort’
  4933. function. The prototype for this function is in ‘stdlib.h’.
  4934. -- Function: void qsort (void *ARRAY, size_t COUNT, size_t SIZE,
  4935. comparison_fn_t COMPARE)
  4936. Preliminary: | MT-Safe | AS-Safe | AC-Unsafe corrupt | *Note POSIX
  4937. Safety Concepts::.
  4938. The ‘qsort’ function sorts the array ARRAY. The array contains
  4939. COUNT elements, each of which is of size SIZE.
  4940. The COMPARE function is used to perform the comparison on the array
  4941. elements. This function is called with two pointer arguments and
  4942. should return an integer less than, equal to, or greater than zero
  4943. corresponding to whether its first argument is considered less
  4944. than, equal to, or greater than its second argument. The function
  4945. must not alter the array's contents, and must define a total
  4946. ordering on the array elements, including any unusual values such
  4947. as floating-point NaN (*note Infinity and NaN::). Because the
  4948. sorting process can move elements, the function's return value must
  4949. not depend on the element addresses or the relative positions of
  4950. elements within the array, as these are meaningless while ‘qsort’
  4951. is running.
  4952. *Warning:* If two elements compare equal, their order after sorting
  4953. is unpredictable. That is to say, the sorting is not stable. This
  4954. can make a difference when the comparison considers only part of
  4955. the elements and two elements that compare equal may differ in
  4956. other respects. To ensure a stable sort in this situation, you can
  4957. augment each element with an appropriate tie-breaking value, such
  4958. as its original array index.
  4959. Here is a simple example of sorting an array of ‘long int’ in
  4960. numerical order, using the comparison function defined above (*note
  4961. Comparison Functions::):
  4962. {
  4963. long int *array;
  4964. size_t nmemb;
  4965. ...
  4966. qsort (array, nmemb, sizeof *array, compare_long_ints);
  4967. }
  4968. The ‘qsort’ function derives its name from the fact that it was
  4969. originally implemented using the "quick sort" algorithm.
  4970. The implementation of ‘qsort’ attempts to allocate auxiliary memory
  4971. and use the merge sort algorithm, without violating C standard
  4972. requirement that arguments passed to the comparison function point
  4973. within the array. If the memory allocation fails, ‘qsort’ resorts
  4974. to a slower algorithm.
  4975. 
  4976. File: libc.info, Node: Search/Sort Example, Next: Hash Search Function, Prev: Array Sort Function, Up: Searching and Sorting
  4977. 9.4 Searching and Sorting Example
  4978. =================================
  4979. Here is an example showing the use of ‘qsort’ and ‘bsearch’ with an
  4980. array of structures. The elements of the array are sorted by comparing
  4981. their ‘name’ fields with the ‘strcmp’ function. Then, we can look up
  4982. individual elements based on their names.
  4983. #include <stdlib.h>
  4984. #include <stdio.h>
  4985. #include <string.h>
  4986. /* Define an array of critters to sort. */
  4987. struct critter
  4988. {
  4989. const char *name;
  4990. const char *species;
  4991. };
  4992. struct critter muppets[] =
  4993. {
  4994. {"Kermit", "frog"},
  4995. {"Piggy", "pig"},
  4996. {"Gonzo", "whatever"},
  4997. {"Fozzie", "bear"},
  4998. {"Sam", "eagle"},
  4999. {"Robin", "frog"},
  5000. {"Animal", "animal"},
  5001. {"Camilla", "chicken"},
  5002. {"Sweetums", "monster"},
  5003. {"Dr. Strangepork", "pig"},
  5004. {"Link Hogthrob", "pig"},
  5005. {"Zoot", "human"},
  5006. {"Dr. Bunsen Honeydew", "human"},
  5007. {"Beaker", "human"},
  5008. {"Swedish Chef", "human"}
  5009. };
  5010. int count = sizeof (muppets) / sizeof (struct critter);
  5011. /* This is the comparison function used for sorting and searching. */
  5012. int
  5013. critter_cmp (const void *v1, const void *v2)
  5014. {
  5015. const struct critter *c1 = v1;
  5016. const struct critter *c2 = v2;
  5017. return strcmp (c1->name, c2->name);
  5018. }
  5019. /* Print information about a critter. */
  5020. void
  5021. print_critter (const struct critter *c)
  5022. {
  5023. printf ("%s, the %s\n", c->name, c->species);
  5024. }
  5025. /* Do the lookup into the sorted array. */
  5026. void
  5027. find_critter (const char *name)
  5028. {
  5029. struct critter target, *result;
  5030. target.name = name;
  5031. result = bsearch (&target, muppets, count, sizeof (struct critter),
  5032. critter_cmp);
  5033. if (result)
  5034. print_critter (result);
  5035. else
  5036. printf ("Couldn't find %s.\n", name);
  5037. }
  5038. /* Main program. */
  5039. int
  5040. main (void)
  5041. {
  5042. int i;
  5043. for (i = 0; i < count; i++)
  5044. print_critter (&muppets[i]);
  5045. printf ("\n");
  5046. qsort (muppets, count, sizeof (struct critter), critter_cmp);
  5047. for (i = 0; i < count; i++)
  5048. print_critter (&muppets[i]);
  5049. printf ("\n");
  5050. find_critter ("Kermit");
  5051. find_critter ("Gonzo");
  5052. find_critter ("Janice");
  5053. return 0;
  5054. }
  5055. The output from this program looks like:
  5056. Kermit, the frog
  5057. Piggy, the pig
  5058. Gonzo, the whatever
  5059. Fozzie, the bear
  5060. Sam, the eagle
  5061. Robin, the frog
  5062. Animal, the animal
  5063. Camilla, the chicken
  5064. Sweetums, the monster
  5065. Dr. Strangepork, the pig
  5066. Link Hogthrob, the pig
  5067. Zoot, the human
  5068. Dr. Bunsen Honeydew, the human
  5069. Beaker, the human
  5070. Swedish Chef, the human
  5071. Animal, the animal
  5072. Beaker, the human
  5073. Camilla, the chicken
  5074. Dr. Bunsen Honeydew, the human
  5075. Dr. Strangepork, the pig
  5076. Fozzie, the bear
  5077. Gonzo, the whatever
  5078. Kermit, the frog
  5079. Link Hogthrob, the pig
  5080. Piggy, the pig
  5081. Robin, the frog
  5082. Sam, the eagle
  5083. Swedish Chef, the human
  5084. Sweetums, the monster
  5085. Zoot, the human
  5086. Kermit, the frog
  5087. Gonzo, the whatever
  5088. Couldn't find Janice.
  5089. 
  5090. File: libc.info, Node: Hash Search Function, Next: Tree Search Function, Prev: Search/Sort Example, Up: Searching and Sorting
  5091. 9.5 The ‘hsearch’ function.
  5092. ===========================
  5093. The functions mentioned so far in this chapter are for searching in a
  5094. sorted or unsorted array. There are other methods to organize
  5095. information which later should be searched. The costs of insert, delete
  5096. and search differ. One possible implementation is using hashing tables.
  5097. The following functions are declared in the header file ‘search.h’.
  5098. -- Function: int hcreate (size_t NEL)
  5099. Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe heap | AC-Unsafe
  5100. corrupt mem | *Note POSIX Safety Concepts::.
  5101. The ‘hcreate’ function creates a hashing table which can contain at
  5102. least NEL elements. There is no possibility to grow this table so
  5103. it is necessary to choose the value for NEL wisely. The method
  5104. used to implement this function might make it necessary to make the
  5105. number of elements in the hashing table larger than the expected
  5106. maximal number of elements. Hashing tables usually work
  5107. inefficiently if they are filled 80% or more. The constant access
  5108. time guaranteed by hashing can only be achieved if few collisions
  5109. exist. See Knuth's "The Art of Computer Programming, Part 3:
  5110. Searching and Sorting" for more information.
  5111. The weakest aspect of this function is that there can be at most
  5112. one hashing table used through the whole program. The table is
  5113. allocated in local memory out of control of the programmer. As an
  5114. extension the GNU C Library provides an additional set of functions
  5115. with a reentrant interface which provides a similar interface but
  5116. which allows keeping arbitrarily many hashing tables.
  5117. It is possible to use more than one hashing table in the program
  5118. run if the former table is first destroyed by a call to ‘hdestroy’.
  5119. The function returns a non-zero value if successful. If it returns
  5120. zero, something went wrong. This could either mean there is
  5121. already a hashing table in use or the program ran out of memory.
  5122. -- Function: void hdestroy (void)
  5123. Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe heap | AC-Unsafe
  5124. corrupt mem | *Note POSIX Safety Concepts::.
  5125. The ‘hdestroy’ function can be used to free all the resources
  5126. allocated in a previous call of ‘hcreate’. After a call to this
  5127. function it is again possible to call ‘hcreate’ and allocate a new
  5128. table with possibly different size.
  5129. It is important to remember that the elements contained in the
  5130. hashing table at the time ‘hdestroy’ is called are _not_ freed by
  5131. this function. It is the responsibility of the program code to
  5132. free those strings (if necessary at all). Freeing all the element
  5133. memory is not possible without extra, separately kept information
  5134. since there is no function to iterate through all available
  5135. elements in the hashing table. If it is really necessary to free a
  5136. table and all elements the programmer has to keep a list of all
  5137. table elements and before calling ‘hdestroy’ s/he has to free all
  5138. element's data using this list. This is a very unpleasant
  5139. mechanism and it also shows that this kind of hashing table is
  5140. mainly meant for tables which are created once and used until the
  5141. end of the program run.
  5142. Entries of the hashing table and keys for the search are defined
  5143. using this type:
  5144. -- Data type: ENTRY
  5145. ‘char *key’
  5146. Pointer to a zero-terminated string of characters describing
  5147. the key for the search or the element in the hashing table.
  5148. This is a limiting restriction of the functionality of the
  5149. ‘hsearch’ functions: They can only be used for data sets which
  5150. use the NUL character always and solely to terminate keys. It
  5151. is not possible to handle general binary data for keys.
  5152. ‘void *data’
  5153. Generic pointer for use by the application. The hashing table
  5154. implementation preserves this pointer in entries, but does not
  5155. use it in any way otherwise.
  5156. -- Data type: struct entry
  5157. The underlying type of ‘ENTRY’.
  5158. -- Function: ENTRY * hsearch (ENTRY ITEM, ACTION ACTION)
  5159. Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe | AC-Unsafe
  5160. corrupt/action==ENTER | *Note POSIX Safety Concepts::.
  5161. To search in a hashing table created using ‘hcreate’ the ‘hsearch’
  5162. function must be used. This function can perform a simple search
  5163. for an element (if ACTION has the value ‘FIND’) or it can
  5164. alternatively insert the key element into the hashing table.
  5165. Entries are never replaced.
  5166. The key is denoted by a pointer to an object of type ‘ENTRY’. For
  5167. locating the corresponding position in the hashing table only the
  5168. ‘key’ element of the structure is used.
  5169. If an entry with a matching key is found the ACTION parameter is
  5170. irrelevant. The found entry is returned. If no matching entry is
  5171. found and the ACTION parameter has the value ‘FIND’ the function
  5172. returns a ‘NULL’ pointer. If no entry is found and the ACTION
  5173. parameter has the value ‘ENTER’ a new entry is added to the hashing
  5174. table which is initialized with the parameter ITEM. A pointer to
  5175. the newly added entry is returned.
  5176. As mentioned before, the hashing table used by the functions
  5177. described so far is global and there can be at any time at most one
  5178. hashing table in the program. A solution is to use the following
  5179. functions which are a GNU extension. All have in common that they
  5180. operate on a hashing table which is described by the content of an
  5181. object of the type ‘struct hsearch_data’. This type should be treated
  5182. as opaque, none of its members should be changed directly.
  5183. -- Function: int hcreate_r (size_t NEL, struct hsearch_data *HTAB)
  5184. Preliminary: | MT-Safe race:htab | AS-Unsafe heap | AC-Unsafe
  5185. corrupt mem | *Note POSIX Safety Concepts::.
  5186. The ‘hcreate_r’ function initializes the object pointed to by HTAB
  5187. to contain a hashing table with at least NEL elements. So this
  5188. function is equivalent to the ‘hcreate’ function except that the
  5189. initialized data structure is controlled by the user.
  5190. This allows having more than one hashing table at one time. The
  5191. memory necessary for the ‘struct hsearch_data’ object can be
  5192. allocated dynamically. It must be initialized with zero before
  5193. calling this function.
  5194. The return value is non-zero if the operation was successful. If
  5195. the return value is zero, something went wrong, which probably
  5196. means the program ran out of memory.
  5197. -- Function: void hdestroy_r (struct hsearch_data *HTAB)
  5198. Preliminary: | MT-Safe race:htab | AS-Unsafe heap | AC-Unsafe
  5199. corrupt mem | *Note POSIX Safety Concepts::.
  5200. The ‘hdestroy_r’ function frees all resources allocated by the
  5201. ‘hcreate_r’ function for this very same object HTAB. As for
  5202. ‘hdestroy’ it is the program's responsibility to free the strings
  5203. for the elements of the table.
  5204. -- Function: int hsearch_r (ENTRY ITEM, ACTION ACTION, ENTRY **RETVAL,
  5205. struct hsearch_data *HTAB)
  5206. Preliminary: | MT-Safe race:htab | AS-Safe | AC-Unsafe
  5207. corrupt/action==ENTER | *Note POSIX Safety Concepts::.
  5208. The ‘hsearch_r’ function is equivalent to ‘hsearch’. The meaning
  5209. of the first two arguments is identical. But instead of operating
  5210. on a single global hashing table the function works on the table
  5211. described by the object pointed to by HTAB (which is initialized by
  5212. a call to ‘hcreate_r’).
  5213. Another difference to ‘hcreate’ is that the pointer to the found
  5214. entry in the table is not the return value of the function. It is
  5215. returned by storing it in a pointer variable pointed to by the
  5216. RETVAL parameter. The return value of the function is an integer
  5217. value indicating success if it is non-zero and failure if it is
  5218. zero. In the latter case the global variable ‘errno’ signals the
  5219. reason for the failure.
  5220. ‘ENOMEM’
  5221. The table is filled and ‘hsearch_r’ was called with a so far
  5222. unknown key and ACTION set to ‘ENTER’.
  5223. ‘ESRCH’
  5224. The ACTION parameter is ‘FIND’ and no corresponding element is
  5225. found in the table.
  5226. 
  5227. File: libc.info, Node: Tree Search Function, Prev: Hash Search Function, Up: Searching and Sorting
  5228. 9.6 The ‘tsearch’ function.
  5229. ===========================
  5230. Another common form to organize data for efficient search is to use
  5231. trees. The ‘tsearch’ function family provides a nice interface to
  5232. functions to organize possibly large amounts of data by providing a mean
  5233. access time proportional to the logarithm of the number of elements.
  5234. The GNU C Library implementation even guarantees that this bound is
  5235. never exceeded even for input data which cause problems for simple
  5236. binary tree implementations.
  5237. The functions described in the chapter are all described in the
  5238. System V and X/Open specifications and are therefore quite portable.
  5239. In contrast to the ‘hsearch’ functions the ‘tsearch’ functions can be
  5240. used with arbitrary data and not only zero-terminated strings.
  5241. The ‘tsearch’ functions have the advantage that no function to
  5242. initialize data structures is necessary. A simple pointer of type ‘void
  5243. *’ initialized to ‘NULL’ is a valid tree and can be extended or
  5244. searched. The prototypes for these functions can be found in the header
  5245. file ‘search.h’.
  5246. -- Function: void * tsearch (const void *KEY, void **ROOTP,
  5247. comparison_fn_t COMPAR)
  5248. Preliminary: | MT-Safe race:rootp | AS-Unsafe heap | AC-Unsafe
  5249. corrupt mem | *Note POSIX Safety Concepts::.
  5250. The ‘tsearch’ function searches in the tree pointed to by ‘*ROOTP’
  5251. for an element matching KEY. The function pointed to by COMPAR is
  5252. used to determine whether two elements match. *Note Comparison
  5253. Functions::, for a specification of the functions which can be used
  5254. for the COMPAR parameter.
  5255. If the tree does not contain a matching entry the KEY value will be
  5256. added to the tree. ‘tsearch’ does not make a copy of the object
  5257. pointed to by KEY (how could it since the size is unknown).
  5258. Instead it adds a reference to this object which means the object
  5259. must be available as long as the tree data structure is used.
  5260. The tree is represented by a pointer to a pointer since it is
  5261. sometimes necessary to change the root node of the tree. So it
  5262. must not be assumed that the variable pointed to by ROOTP has the
  5263. same value after the call. This also shows that it is not safe to
  5264. call the ‘tsearch’ function more than once at the same time using
  5265. the same tree. It is no problem to run it more than once at a time
  5266. on different trees.
  5267. The return value is a pointer to the matching element in the tree.
  5268. If a new element was created the pointer points to the new data
  5269. (which is in fact KEY). If an entry had to be created and the
  5270. program ran out of space ‘NULL’ is returned.
  5271. -- Function: void * tfind (const void *KEY, void *const *ROOTP,
  5272. comparison_fn_t COMPAR)
  5273. Preliminary: | MT-Safe race:rootp | AS-Safe | AC-Safe | *Note POSIX
  5274. Safety Concepts::.
  5275. The ‘tfind’ function is similar to the ‘tsearch’ function. It
  5276. locates an element matching the one pointed to by KEY and returns a
  5277. pointer to this element. But if no matching element is available
  5278. no new element is entered (note that the ROOTP parameter points to
  5279. a constant pointer). Instead the function returns ‘NULL’.
  5280. Another advantage of the ‘tsearch’ functions in contrast to the
  5281. ‘hsearch’ functions is that there is an easy way to remove elements.
  5282. -- Function: void * tdelete (const void *KEY, void **ROOTP,
  5283. comparison_fn_t COMPAR)
  5284. Preliminary: | MT-Safe race:rootp | AS-Unsafe heap | AC-Unsafe
  5285. corrupt mem | *Note POSIX Safety Concepts::.
  5286. To remove a specific element matching KEY from the tree ‘tdelete’
  5287. can be used. It locates the matching element using the same method
  5288. as ‘tfind’. The corresponding element is then removed and a
  5289. pointer to the parent of the deleted node is returned by the
  5290. function. If there is no matching entry in the tree nothing can be
  5291. deleted and the function returns ‘NULL’. If the root of the tree
  5292. is deleted ‘tdelete’ returns some unspecified value not equal to
  5293. ‘NULL’.
  5294. -- Function: void tdestroy (void *VROOT, __free_fn_t FREEFCT)
  5295. Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
  5296. POSIX Safety Concepts::.
  5297. If the complete search tree has to be removed one can use
  5298. ‘tdestroy’. It frees all resources allocated by the ‘tsearch’
  5299. functions to generate the tree pointed to by VROOT.
  5300. For the data in each tree node the function FREEFCT is called. The
  5301. pointer to the data is passed as the argument to the function. If
  5302. no such work is necessary FREEFCT must point to a function doing
  5303. nothing. It is called in any case.
  5304. This function is a GNU extension and not covered by the System V or
  5305. X/Open specifications.
  5306. In addition to the functions to create and destroy the tree data
  5307. structure, there is another function which allows you to apply a
  5308. function to all elements of the tree. The function must have this type:
  5309. void __action_fn_t (const void *nodep, VISIT value, int level);
  5310. The NODEP is the data value of the current node (once given as the
  5311. KEY argument to ‘tsearch’). LEVEL is a numeric value which corresponds
  5312. to the depth of the current node in the tree. The root node has the
  5313. depth 0 and its children have a depth of 1 and so on. The ‘VISIT’ type
  5314. is an enumeration type.
  5315. -- Data Type: VISIT
  5316. The ‘VISIT’ value indicates the status of the current node in the
  5317. tree and how the function is called. The status of a node is
  5318. either 'leaf' or 'internal node'. For each leaf node the function
  5319. is called exactly once, for each internal node it is called three
  5320. times: before the first child is processed, after the first child
  5321. is processed and after both children are processed. This makes it
  5322. possible to handle all three methods of tree traversal (or even a
  5323. combination of them).
  5324. ‘preorder’
  5325. The current node is an internal node and the function is
  5326. called before the first child was processed.
  5327. ‘postorder’
  5328. The current node is an internal node and the function is
  5329. called after the first child was processed.
  5330. ‘endorder’
  5331. The current node is an internal node and the function is
  5332. called after the second child was processed.
  5333. ‘leaf’
  5334. The current node is a leaf.
  5335. -- Function: void twalk (const void *ROOT, __action_fn_t ACTION)
  5336. Preliminary: | MT-Safe race:root | AS-Safe | AC-Safe | *Note POSIX
  5337. Safety Concepts::.
  5338. For each node in the tree with a node pointed to by ROOT, the
  5339. ‘twalk’ function calls the function provided by the parameter
  5340. ACTION. For leaf nodes the function is called exactly once with
  5341. VALUE set to ‘leaf’. For internal nodes the function is called
  5342. three times, setting the VALUE parameter or ACTION to the
  5343. appropriate value. The LEVEL argument for the ACTION function is
  5344. computed while descending the tree by increasing the value by one
  5345. for each descent to a child, starting with the value 0 for the root
  5346. node.
  5347. Since the functions used for the ACTION parameter to ‘twalk’ must
  5348. not modify the tree data, it is safe to run ‘twalk’ in more than
  5349. one thread at the same time, working on the same tree. It is also
  5350. safe to call ‘tfind’ in parallel. Functions which modify the tree
  5351. must not be used, otherwise the behavior is undefined. However, it
  5352. is difficult to pass data external to the tree to the callback
  5353. function without resorting to global variables (and thread safety
  5354. issues), so see the ‘twalk_r’ function below.
  5355. -- Function: void twalk_r (const void *ROOT, void (*ACTION) (const void
  5356. *KEY, VISIT WHICH, void *CLOSURE), void *CLOSURE)
  5357. Preliminary: | MT-Safe race:root | AS-Safe | AC-Safe | *Note POSIX
  5358. Safety Concepts::.
  5359. For each node in the tree with a node pointed to by ROOT, the
  5360. ‘twalk_r’ function calls the function provided by the parameter
  5361. ACTION. For leaf nodes the function is called exactly once with
  5362. WHICH set to ‘leaf’. For internal nodes the function is called
  5363. three times, setting the WHICH parameter of ACTION to the
  5364. appropriate value. The CLOSURE parameter is passed down to each
  5365. call of the ACTION function, unmodified.
  5366. It is possible to implement the ‘twalk’ function on top of the
  5367. ‘twalk_r’ function, which is why there is no separate level
  5368. parameter.
  5369. #define _GNU_SOURCE 1
  5370. #include <search.h>
  5371. struct twalk_with_twalk_r_closure
  5372. {
  5373. void (*action) (const void *, VISIT, int);
  5374. int depth;
  5375. };
  5376. static void
  5377. twalk_with_twalk_r_action (const void *nodep, VISIT which, void *closure0)
  5378. {
  5379. struct twalk_with_twalk_r_closure *closure = closure0;
  5380. switch (which)
  5381. {
  5382. case leaf:
  5383. closure->action (nodep, which, closure->depth);
  5384. break;
  5385. case preorder:
  5386. closure->action (nodep, which, closure->depth);
  5387. ++closure->depth;
  5388. break;
  5389. case postorder:
  5390. /* The preorder action incremented the depth. */
  5391. closure->action (nodep, which, closure->depth - 1);
  5392. break;
  5393. case endorder:
  5394. --closure->depth;
  5395. closure->action (nodep, which, closure->depth);
  5396. break;
  5397. }
  5398. }
  5399. void
  5400. twalk (const void *root, void (*action) (const void *, VISIT, int))
  5401. {
  5402. struct twalk_with_twalk_r_closure closure = { action, 0 };
  5403. twalk_r (root, twalk_with_twalk_r_action, &closure);
  5404. }
  5405. 
  5406. File: libc.info, Node: Pattern Matching, Next: I/O Overview, Prev: Searching and Sorting, Up: Top
  5407. 10 Pattern Matching
  5408. *******************
  5409. The GNU C Library provides pattern matching facilities for two kinds of
  5410. patterns: regular expressions and file-name wildcards. The library also
  5411. provides a facility for expanding variable and command references and
  5412. parsing text into words in the way the shell does.
  5413. * Menu:
  5414. * Wildcard Matching:: Matching a wildcard pattern against a single string.
  5415. * Globbing:: Finding the files that match a wildcard pattern.
  5416. * Regular Expressions:: Matching regular expressions against strings.
  5417. * Word Expansion:: Expanding shell variables, nested commands,
  5418. arithmetic, and wildcards.
  5419. This is what the shell does with shell commands.
  5420. 
  5421. File: libc.info, Node: Wildcard Matching, Next: Globbing, Up: Pattern Matching
  5422. 10.1 Wildcard Matching
  5423. ======================
  5424. This section describes how to match a wildcard pattern against a
  5425. particular string. The result is a yes or no answer: does the string
  5426. fit the pattern or not. The symbols described here are all declared in
  5427. ‘fnmatch.h’.
  5428. -- Function: int fnmatch (const char *PATTERN, const char *STRING, int
  5429. FLAGS)
  5430. Preliminary: | MT-Safe env locale | AS-Unsafe heap | AC-Unsafe mem
  5431. | *Note POSIX Safety Concepts::.
  5432. This function tests whether the string STRING matches the pattern
  5433. PATTERN. It returns ‘0’ if they do match; otherwise, it returns
  5434. the nonzero value ‘FNM_NOMATCH’. The arguments PATTERN and STRING
  5435. are both strings.
  5436. The argument FLAGS is a combination of flag bits that alter the
  5437. details of matching. See below for a list of the defined flags.
  5438. In the GNU C Library, ‘fnmatch’ might sometimes report "errors" by
  5439. returning nonzero values that are not equal to ‘FNM_NOMATCH’.
  5440. These are the available flags for the FLAGS argument:
  5441. ‘FNM_FILE_NAME’
  5442. Treat the ‘/’ character specially, for matching file names. If
  5443. this flag is set, wildcard constructs in PATTERN cannot match ‘/’
  5444. in STRING. Thus, the only way to match ‘/’ is with an explicit ‘/’
  5445. in PATTERN.
  5446. ‘FNM_PATHNAME’
  5447. This is an alias for ‘FNM_FILE_NAME’; it comes from POSIX.2. We
  5448. don't recommend this name because we don't use the term "pathname"
  5449. for file names.
  5450. ‘FNM_PERIOD’
  5451. Treat the ‘.’ character specially if it appears at the beginning of
  5452. STRING. If this flag is set, wildcard constructs in PATTERN cannot
  5453. match ‘.’ as the first character of STRING.
  5454. If you set both ‘FNM_PERIOD’ and ‘FNM_FILE_NAME’, then the special
  5455. treatment applies to ‘.’ following ‘/’ as well as to ‘.’ at the
  5456. beginning of STRING. (The shell uses the ‘FNM_PERIOD’ and
  5457. ‘FNM_FILE_NAME’ flags together for matching file names.)
  5458. ‘FNM_NOESCAPE’
  5459. Don't treat the ‘\’ character specially in patterns. Normally, ‘\’
  5460. quotes the following character, turning off its special meaning (if
  5461. any) so that it matches only itself. When quoting is enabled, the
  5462. pattern ‘\?’ matches only the string ‘?’, because the question mark
  5463. in the pattern acts like an ordinary character.
  5464. If you use ‘FNM_NOESCAPE’, then ‘\’ is an ordinary character.
  5465. ‘FNM_LEADING_DIR’
  5466. Ignore a trailing sequence of characters starting with a ‘/’ in
  5467. STRING; that is to say, test whether STRING starts with a directory
  5468. name that PATTERN matches.
  5469. If this flag is set, either ‘foo*’ or ‘foobar’ as a pattern would
  5470. match the string ‘foobar/frobozz’.
  5471. ‘FNM_CASEFOLD’
  5472. Ignore case in comparing STRING to PATTERN.
  5473. This macro was originally a GNU extension, but was added in
  5474. POSIX.1-2024.
  5475. ‘FNM_EXTMATCH’
  5476. Besides the normal patterns, also recognize the extended patterns
  5477. introduced in ‘ksh’. The patterns are written in the form
  5478. explained in the following table where PATTERN-LIST is a ‘|’
  5479. separated list of patterns.
  5480. ‘?(PATTERN-LIST)’
  5481. The pattern matches if zero or one occurrences of any of the
  5482. patterns in the PATTERN-LIST allow matching the input string.
  5483. ‘*(PATTERN-LIST)’
  5484. The pattern matches if zero or more occurrences of any of the
  5485. patterns in the PATTERN-LIST allow matching the input string.
  5486. ‘+(PATTERN-LIST)’
  5487. The pattern matches if one or more occurrences of any of the
  5488. patterns in the PATTERN-LIST allow matching the input string.
  5489. ‘@(PATTERN-LIST)’
  5490. The pattern matches if exactly one occurrence of any of the
  5491. patterns in the PATTERN-LIST allows matching the input string.
  5492. ‘!(PATTERN-LIST)’
  5493. The pattern matches if the input string cannot be matched with
  5494. any of the patterns in the PATTERN-LIST.
  5495. 
  5496. File: libc.info, Node: Globbing, Next: Regular Expressions, Prev: Wildcard Matching, Up: Pattern Matching
  5497. 10.2 Globbing
  5498. =============
  5499. The archetypal use of wildcards is for matching against the files in a
  5500. directory, and making a list of all the matches. This is called
  5501. “globbing”.
  5502. You could do this using ‘fnmatch’, by reading the directory entries
  5503. one by one and testing each one with ‘fnmatch’. But that would be slow
  5504. (and complex, since you would have to handle subdirectories by hand).
  5505. The library provides a function ‘glob’ to make this particular use of
  5506. wildcards convenient. ‘glob’ and the other symbols in this section are
  5507. declared in ‘glob.h’.
  5508. * Menu:
  5509. * Calling Glob:: Basic use of ‘glob’.
  5510. * Flags for Globbing:: Flags that enable various options in ‘glob’.
  5511. * More Flags for Globbing:: GNU specific extensions to ‘glob’.
  5512. 
  5513. File: libc.info, Node: Calling Glob, Next: Flags for Globbing, Up: Globbing
  5514. 10.2.1 Calling ‘glob’
  5515. ---------------------
  5516. The result of globbing is a vector of file names (strings). To return
  5517. this vector, ‘glob’ uses a special data type, ‘glob_t’, which is a
  5518. structure. You pass ‘glob’ the address of the structure, and it fills
  5519. in the structure's fields to tell you about the results.
  5520. -- Data Type: glob_t
  5521. This data type holds a pointer to a word vector. More precisely,
  5522. it records both the address of the word vector and its size. The
  5523. GNU implementation contains some more fields which are non-standard
  5524. extensions.
  5525. ‘gl_pathc’
  5526. The number of elements in the vector, excluding the initial
  5527. null entries if the GLOB_DOOFFS flag is used (see gl_offs
  5528. below).
  5529. ‘gl_pathv’
  5530. The address of the vector. This field has type ‘char **’.
  5531. ‘gl_offs’
  5532. The offset of the first real element of the vector, from its
  5533. nominal address in the ‘gl_pathv’ field. Unlike the other
  5534. fields, this is always an input to ‘glob’, rather than an
  5535. output from it.
  5536. If you use a nonzero offset, then that many elements at the
  5537. beginning of the vector are left empty. (The ‘glob’ function
  5538. fills them with null pointers.)
  5539. The ‘gl_offs’ field is meaningful only if you use the
  5540. ‘GLOB_DOOFFS’ flag. Otherwise, the offset is always zero
  5541. regardless of what is in this field, and the first real
  5542. element comes at the beginning of the vector.
  5543. ‘gl_closedir’
  5544. The address of an alternative implementation of the ‘closedir’
  5545. function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
  5546. the flag parameter. The type of this field is
  5547. ‘void (*) (void *)’.
  5548. This is a GNU extension.
  5549. ‘gl_readdir’
  5550. The address of an alternative implementation of the ‘readdir’
  5551. function used to read the contents of a directory. It is used
  5552. if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter.
  5553. The type of this field is ‘struct dirent *(*) (void *)’.
  5554. An implementation of ‘gl_readdir’ needs to initialize the
  5555. following members of the ‘struct dirent’ object:
  5556. ‘d_type’
  5557. This member should be set to the file type of the entry
  5558. if it is known. Otherwise, the value ‘DT_UNKNOWN’ can be
  5559. used. The ‘glob’ function may use the specified file
  5560. type to avoid callbacks in cases where the file type
  5561. indicates that the data is not required.
  5562. ‘d_ino’
  5563. This member needs to be non-zero, otherwise ‘glob’ may
  5564. skip the current entry and call the ‘gl_readdir’ callback
  5565. function again to retrieve another entry.
  5566. ‘d_name’
  5567. This member must be set to the name of the entry. It
  5568. must be null-terminated.
  5569. The example below shows how to allocate a ‘struct dirent’
  5570. object containing a given name.
  5571. #include <dirent.h>
  5572. #include <errno.h>
  5573. #include <stddef.h>
  5574. #include <stdlib.h>
  5575. #include <string.h>
  5576. struct dirent *
  5577. mkdirent (const char *name)
  5578. {
  5579. size_t dirent_size = offsetof (struct dirent, d_name) + 1;
  5580. size_t name_length = strlen (name);
  5581. size_t total_size = dirent_size + name_length;
  5582. if (total_size < dirent_size)
  5583. {
  5584. errno = ENOMEM;
  5585. return NULL;
  5586. }
  5587. struct dirent *result = malloc (total_size);
  5588. if (result == NULL)
  5589. return NULL;
  5590. result->d_type = DT_UNKNOWN;
  5591. result->d_ino = 1; /* Do not skip this entry. */
  5592. memcpy (result->d_name, name, name_length + 1);
  5593. return result;
  5594. }
  5595. The ‘glob’ function reads the ‘struct dirent’ members listed
  5596. above and makes a copy of the file name in the ‘d_name’ member
  5597. immediately after the ‘gl_readdir’ callback function returns.
  5598. Future invocations of any of the callback functions may
  5599. deallocate or reuse the buffer. It is the responsibility of
  5600. the caller of the ‘glob’ function to allocate and deallocate
  5601. the buffer, around the call to ‘glob’ or using the callback
  5602. functions. For example, an application could allocate the
  5603. buffer in the ‘gl_readdir’ callback function, and deallocate
  5604. it in the ‘gl_closedir’ callback function.
  5605. The ‘gl_readdir’ member is a GNU extension.
  5606. ‘gl_opendir’
  5607. The address of an alternative implementation of the ‘opendir’
  5608. function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
  5609. the flag parameter. The type of this field is
  5610. ‘void *(*) (const char *)’.
  5611. This is a GNU extension.
  5612. ‘gl_stat’
  5613. The address of an alternative implementation of the ‘stat’
  5614. function to get information about an object in the filesystem.
  5615. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
  5616. parameter. The type of this field is
  5617. ‘int (*) (const char *, struct stat *)’.
  5618. This is a GNU extension.
  5619. ‘gl_lstat’
  5620. The address of an alternative implementation of the ‘lstat’
  5621. function to get information about an object in the
  5622. filesystems, not following symbolic links. It is used if the
  5623. ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter. The type
  5624. of this field is ‘int (*) (const char *, struct stat *)’.
  5625. This is a GNU extension.
  5626. ‘gl_flags’
  5627. The flags used when ‘glob’ was called. In addition,
  5628. ‘GLOB_MAGCHAR’ might be set. See *note Flags for Globbing::
  5629. for more details.
  5630. This is a GNU extension.
  5631. For use in the ‘glob64’ function ‘glob.h’ contains another definition
  5632. for a very similar type. ‘glob64_t’ differs from ‘glob_t’ only in the
  5633. types of the members ‘gl_readdir’, ‘gl_stat’, and ‘gl_lstat’.
  5634. -- Data Type: glob64_t
  5635. This data type holds a pointer to a word vector. More precisely,
  5636. it records both the address of the word vector and its size. The
  5637. GNU implementation contains some more fields which are non-standard
  5638. extensions.
  5639. ‘gl_pathc’
  5640. The number of elements in the vector, excluding the initial
  5641. null entries if the GLOB_DOOFFS flag is used (see gl_offs
  5642. below).
  5643. ‘gl_pathv’
  5644. The address of the vector. This field has type ‘char **’.
  5645. ‘gl_offs’
  5646. The offset of the first real element of the vector, from its
  5647. nominal address in the ‘gl_pathv’ field. Unlike the other
  5648. fields, this is always an input to ‘glob’, rather than an
  5649. output from it.
  5650. If you use a nonzero offset, then that many elements at the
  5651. beginning of the vector are left empty. (The ‘glob’ function
  5652. fills them with null pointers.)
  5653. The ‘gl_offs’ field is meaningful only if you use the
  5654. ‘GLOB_DOOFFS’ flag. Otherwise, the offset is always zero
  5655. regardless of what is in this field, and the first real
  5656. element comes at the beginning of the vector.
  5657. ‘gl_closedir’
  5658. The address of an alternative implementation of the ‘closedir’
  5659. function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
  5660. the flag parameter. The type of this field is
  5661. ‘void (*) (void *)’.
  5662. This is a GNU extension.
  5663. ‘gl_readdir’
  5664. The address of an alternative implementation of the
  5665. ‘readdir64’ function used to read the contents of a directory.
  5666. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
  5667. parameter. The type of this field is
  5668. ‘struct dirent64 *(*) (void *)’.
  5669. This is a GNU extension.
  5670. ‘gl_opendir’
  5671. The address of an alternative implementation of the ‘opendir’
  5672. function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
  5673. the flag parameter. The type of this field is
  5674. ‘void *(*) (const char *)’.
  5675. This is a GNU extension.
  5676. ‘gl_stat’
  5677. The address of an alternative implementation of the ‘stat64’
  5678. function to get information about an object in the filesystem.
  5679. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
  5680. parameter. The type of this field is
  5681. ‘int (*) (const char *, struct stat64 *)’.
  5682. This is a GNU extension.
  5683. ‘gl_lstat’
  5684. The address of an alternative implementation of the ‘lstat64’
  5685. function to get information about an object in the
  5686. filesystems, not following symbolic links. It is used if the
  5687. ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter. The type
  5688. of this field is ‘int (*) (const char *, struct stat64 *)’.
  5689. This is a GNU extension.
  5690. ‘gl_flags’
  5691. The flags used when ‘glob’ was called. In addition,
  5692. ‘GLOB_MAGCHAR’ might be set. See *note Flags for Globbing::
  5693. for more details.
  5694. This is a GNU extension.
  5695. -- Function: int glob (const char *PATTERN, int FLAGS, int (*ERRFUNC)
  5696. (const char *FILENAME, int ERROR-CODE), glob_t *VECTOR-PTR)
  5697. Preliminary: | MT-Unsafe race:utent env sig:ALRM timer locale |
  5698. AS-Unsafe dlopen plugin corrupt heap lock | AC-Unsafe corrupt lock
  5699. fd mem | *Note POSIX Safety Concepts::.
  5700. The function ‘glob’ does globbing using the pattern PATTERN in the
  5701. current directory. It puts the result in a newly allocated vector,
  5702. and stores the size and address of this vector into ‘*VECTOR-PTR’.
  5703. The argument FLAGS is a combination of bit flags; see *note Flags
  5704. for Globbing::, for details of the flags.
  5705. The result of globbing is a sequence of file names. The function
  5706. ‘glob’ allocates a string for each resulting word, then allocates a
  5707. vector of type ‘char **’ to store the addresses of these strings.
  5708. The last element of the vector is a null pointer. This vector is
  5709. called the “word vector”.
  5710. To return this vector, ‘glob’ stores both its address and its
  5711. length (number of elements, not counting the terminating null
  5712. pointer) into ‘*VECTOR-PTR’.
  5713. Normally, ‘glob’ sorts the file names alphabetically before
  5714. returning them. You can turn this off with the flag ‘GLOB_NOSORT’
  5715. if you want to get the information as fast as possible. Usually
  5716. it's a good idea to let ‘glob’ sort them--if you process the files
  5717. in alphabetical order, the users will have a feel for the rate of
  5718. progress that your application is making.
  5719. If ‘glob’ succeeds, it returns 0. Otherwise, it returns one of
  5720. these error codes:
  5721. ‘GLOB_ABORTED’
  5722. There was an error opening a directory, and you used the flag
  5723. ‘GLOB_ERR’ or your specified ERRFUNC returned a nonzero value.
  5724. *Note Flags for Globbing::, for an explanation of the
  5725. ‘GLOB_ERR’ flag and ERRFUNC.
  5726. ‘GLOB_NOMATCH’
  5727. The pattern didn't match any existing files. If you use the
  5728. ‘GLOB_NOCHECK’ flag, then you never get this error code,
  5729. because that flag tells ‘glob’ to _pretend_ that the pattern
  5730. matched at least one file.
  5731. ‘GLOB_NOSPACE’
  5732. It was impossible to allocate memory to hold the result.
  5733. In the event of an error, ‘glob’ stores information in
  5734. ‘*VECTOR-PTR’ about all the matches it has found so far.
  5735. It is important to notice that the ‘glob’ function will not fail if
  5736. it encounters directories or files which cannot be handled without
  5737. the LFS interfaces. The implementation of ‘glob’ is supposed to
  5738. use these functions internally. This at least is the assumption
  5739. made by the Unix standard. The GNU extension of allowing the user
  5740. to provide their own directory handling and ‘stat’ functions
  5741. complicates things a bit. If these callback functions are used and
  5742. a large file or directory is encountered ‘glob’ _can_ fail.
  5743. -- Function: int glob64 (const char *PATTERN, int FLAGS, int (*ERRFUNC)
  5744. (const char *FILENAME, int ERROR-CODE), glob64_t *VECTOR-PTR)
  5745. Preliminary: | MT-Unsafe race:utent env sig:ALRM timer locale |
  5746. AS-Unsafe dlopen corrupt heap lock | AC-Unsafe corrupt lock fd mem
  5747. | *Note POSIX Safety Concepts::.
  5748. The ‘glob64’ function was added as part of the Large File Summit
  5749. extensions but is not part of the original LFS proposal. The
  5750. reason for this is simple: it is not necessary. The necessity for
  5751. a ‘glob64’ function is added by the extensions of the GNU ‘glob’
  5752. implementation which allows the user to provide their own directory
  5753. handling and ‘stat’ functions. The ‘readdir’ and ‘stat’ functions
  5754. do depend on the choice of ‘_FILE_OFFSET_BITS’ since the definition
  5755. of the types ‘struct dirent’ and ‘struct stat’ will change
  5756. depending on the choice.
  5757. Besides this difference, ‘glob64’ works just like ‘glob’ in all
  5758. aspects.
  5759. This function is a GNU extension.
  5760. 
  5761. File: libc.info, Node: Flags for Globbing, Next: More Flags for Globbing, Prev: Calling Glob, Up: Globbing
  5762. 10.2.2 Flags for Globbing
  5763. -------------------------
  5764. This section describes the standard flags that you can specify in the
  5765. FLAGS argument to ‘glob’. Choose the flags you want, and combine them
  5766. with the C bitwise OR operator ‘|’.
  5767. Note that there are *note More Flags for Globbing:: available as GNU
  5768. extensions.
  5769. ‘GLOB_APPEND’
  5770. Append the words from this expansion to the vector of words
  5771. produced by previous calls to ‘glob’. This way you can effectively
  5772. expand several words as if they were concatenated with spaces
  5773. between them.
  5774. In order for appending to work, you must not modify the contents of
  5775. the word vector structure between calls to ‘glob’. And, if you set
  5776. ‘GLOB_DOOFFS’ in the first call to ‘glob’, you must also set it
  5777. when you append to the results.
  5778. Note that the pointer stored in ‘gl_pathv’ may no longer be valid
  5779. after you call ‘glob’ the second time, because ‘glob’ might have
  5780. relocated the vector. So always fetch ‘gl_pathv’ from the ‘glob_t’
  5781. structure after each ‘glob’ call; *never* save the pointer across
  5782. calls.
  5783. ‘GLOB_DOOFFS’
  5784. Leave blank slots at the beginning of the vector of words. The
  5785. ‘gl_offs’ field says how many slots to leave. The blank slots
  5786. contain null pointers.
  5787. ‘GLOB_ERR’
  5788. Give up right away and report an error if there is any difficulty
  5789. reading the directories that must be read in order to expand
  5790. PATTERN fully. Such difficulties might include a directory in
  5791. which you don't have the requisite access. Normally, ‘glob’ tries
  5792. its best to keep on going despite any errors, reading whatever
  5793. directories it can.
  5794. You can exercise even more control than this by specifying an
  5795. error-handler function ERRFUNC when you call ‘glob’. If ERRFUNC is
  5796. not a null pointer, then ‘glob’ doesn't give up right away when it
  5797. can't read a directory; instead, it calls ERRFUNC with two
  5798. arguments, like this:
  5799. (*ERRFUNC) (FILENAME, ERROR-CODE)
  5800. The argument FILENAME is the name of the directory that ‘glob’
  5801. couldn't open or couldn't read, and ERROR-CODE is the ‘errno’ value
  5802. that was reported to ‘glob’.
  5803. If the error handler function returns nonzero, then ‘glob’ gives up
  5804. right away. Otherwise, it continues.
  5805. ‘GLOB_MARK’
  5806. If the pattern matches the name of a directory, append ‘/’ to the
  5807. directory's name when returning it.
  5808. ‘GLOB_NOCHECK’
  5809. If the pattern doesn't match any file names, return the pattern
  5810. itself as if it were a file name that had been matched. (Normally,
  5811. when the pattern doesn't match anything, ‘glob’ returns that there
  5812. were no matches.)
  5813. ‘GLOB_NOESCAPE’
  5814. Don't treat the ‘\’ character specially in patterns. Normally, ‘\’
  5815. quotes the following character, turning off its special meaning (if
  5816. any) so that it matches only itself. When quoting is enabled, the
  5817. pattern ‘\?’ matches only the string ‘?’, because the question mark
  5818. in the pattern acts like an ordinary character.
  5819. If you use ‘GLOB_NOESCAPE’, then ‘\’ is an ordinary character.
  5820. ‘glob’ does its work by calling the function ‘fnmatch’ repeatedly.
  5821. It handles the flag ‘GLOB_NOESCAPE’ by turning on the
  5822. ‘FNM_NOESCAPE’ flag in calls to ‘fnmatch’.
  5823. ‘GLOB_NOSORT’
  5824. Don't sort the file names; return them in no particular order. (In
  5825. practice, the order will depend on the order of the entries in the
  5826. directory.) The only reason _not_ to sort is to save time.
  5827. 
  5828. File: libc.info, Node: More Flags for Globbing, Prev: Flags for Globbing, Up: Globbing
  5829. 10.2.3 More Flags for Globbing
  5830. ------------------------------
  5831. Beside the flags described in the last section, the GNU implementation
  5832. of ‘glob’ allows a few more flags which are also defined in the ‘glob.h’
  5833. file. Some of the extensions implement functionality which is available
  5834. in modern shell implementations.
  5835. ‘GLOB_PERIOD’
  5836. The ‘.’ character (period) is treated special. It cannot be
  5837. matched by wildcards. *Note Wildcard Matching::, ‘FNM_PERIOD’.
  5838. ‘GLOB_MAGCHAR’
  5839. The ‘GLOB_MAGCHAR’ value is not to be given to ‘glob’ in the FLAGS
  5840. parameter. Instead, ‘glob’ sets this bit in the GL_FLAGS element
  5841. of the GLOB_T structure provided as the result if the pattern used
  5842. for matching contains any wildcard character.
  5843. ‘GLOB_ALTDIRFUNC’
  5844. Instead of using the normal functions for accessing the filesystem
  5845. the ‘glob’ implementation uses the user-supplied functions
  5846. specified in the structure pointed to by PGLOB parameter. For more
  5847. information about the functions refer to the sections about
  5848. directory handling see *note Accessing Directories::, and *note
  5849. Reading Attributes::.
  5850. ‘GLOB_BRACE’
  5851. If this flag is given, the handling of braces in the pattern is
  5852. changed. It is now required that braces appear correctly grouped.
  5853. I.e., for each opening brace there must be a closing one. Braces
  5854. can be used recursively. So it is possible to define one brace
  5855. expression in another one. It is important to note that the range
  5856. of each brace expression is completely contained in the outer brace
  5857. expression (if there is one).
  5858. The string between the matching braces is separated into single
  5859. expressions by splitting at ‘,’ (comma) characters. The commas
  5860. themselves are discarded. Please note what we said above about
  5861. recursive brace expressions. The commas used to separate the
  5862. subexpressions must be at the same level. Commas in brace
  5863. subexpressions are not matched. They are used during expansion of
  5864. the brace expression of the deeper level. The example below shows
  5865. this
  5866. glob ("{foo/{,bar,biz},baz}", GLOB_BRACE, NULL, &result)
  5867. is equivalent to the sequence
  5868. glob ("foo/", GLOB_BRACE, NULL, &result)
  5869. glob ("foo/bar", GLOB_BRACE|GLOB_APPEND, NULL, &result)
  5870. glob ("foo/biz", GLOB_BRACE|GLOB_APPEND, NULL, &result)
  5871. glob ("baz", GLOB_BRACE|GLOB_APPEND, NULL, &result)
  5872. if we leave aside error handling.
  5873. ‘GLOB_NOMAGIC’
  5874. If the pattern contains no wildcard constructs (it is a literal
  5875. file name), return it as the sole "matching" word, even if no file
  5876. exists by that name.
  5877. ‘GLOB_TILDE’
  5878. If this flag is used the character ‘~’ (tilde) is handled specially
  5879. if it appears at the beginning of the pattern. Instead of being
  5880. taken verbatim it is used to represent the home directory of a
  5881. known user.
  5882. If ‘~’ is the only character in pattern or it is followed by a ‘/’
  5883. (slash), the home directory of the process owner is substituted.
  5884. Using ‘getlogin’ and ‘getpwnam’ the information is read from the
  5885. system databases. As an example take user ‘bart’ with his home
  5886. directory at ‘/home/bart’. For him a call like
  5887. glob ("~/bin/*", GLOB_TILDE, NULL, &result)
  5888. would return the contents of the directory ‘/home/bart/bin’.
  5889. Instead of referring to the own home directory it is also possible
  5890. to name the home directory of other users. To do so one has to
  5891. append the user name after the tilde character. So the contents of
  5892. user ‘homer’'s ‘bin’ directory can be retrieved by
  5893. glob ("~homer/bin/*", GLOB_TILDE, NULL, &result)
  5894. If the user name is not valid or the home directory cannot be
  5895. determined for some reason the pattern is left untouched and itself
  5896. used as the result. I.e., if in the last example ‘home’ is not
  5897. available the tilde expansion yields to ‘"~homer/bin/*"’ and ‘glob’
  5898. is not looking for a directory named ‘~homer’.
  5899. This functionality is equivalent to what is available in C-shells
  5900. if the ‘nonomatch’ flag is set.
  5901. ‘GLOB_TILDE_CHECK’
  5902. If this flag is used ‘glob’ behaves as if ‘GLOB_TILDE’ is given.
  5903. The only difference is that if the user name is not available or
  5904. the home directory cannot be determined for other reasons this
  5905. leads to an error. ‘glob’ will return ‘GLOB_NOMATCH’ instead of
  5906. using the pattern itself as the name.
  5907. This functionality is equivalent to what is available in C-shells
  5908. if the ‘nonomatch’ flag is not set.
  5909. ‘GLOB_ONLYDIR’
  5910. If this flag is used the globbing function takes this as a *hint*
  5911. that the caller is only interested in directories matching the
  5912. pattern. If the information about the type of the file is easily
  5913. available non-directories will be rejected but no extra work will
  5914. be done to determine the information for each file. I.e., the
  5915. caller must still be able to filter directories out.
  5916. This functionality is only available with the GNU ‘glob’
  5917. implementation. It is mainly used internally to increase the
  5918. performance but might be useful for a user as well and therefore is
  5919. documented here.
  5920. Calling ‘glob’ will in most cases allocate resources which are used
  5921. to represent the result of the function call. If the same object of
  5922. type ‘glob_t’ is used in multiple call to ‘glob’ the resources are freed
  5923. or reused so that no leaks appear. But this does not include the time
  5924. when all ‘glob’ calls are done.
  5925. -- Function: void globfree (glob_t *PGLOB)
  5926. Preliminary: | MT-Safe | AS-Unsafe corrupt heap | AC-Unsafe corrupt
  5927. mem | *Note POSIX Safety Concepts::.
  5928. The ‘globfree’ function frees all resources allocated by previous
  5929. calls to ‘glob’ associated with the object pointed to by PGLOB.
  5930. This function should be called whenever the currently used ‘glob_t’
  5931. typed object isn't used anymore.
  5932. -- Function: void globfree64 (glob64_t *PGLOB)
  5933. Preliminary: | MT-Safe | AS-Unsafe corrupt lock | AC-Unsafe corrupt
  5934. lock fd mem | *Note POSIX Safety Concepts::.
  5935. This function is equivalent to ‘globfree’ but it frees records of
  5936. type ‘glob64_t’ which were allocated by ‘glob64’.
  5937. 
  5938. File: libc.info, Node: Regular Expressions, Next: Word Expansion, Prev: Globbing, Up: Pattern Matching
  5939. 10.3 Regular Expression Matching
  5940. ================================
  5941. The GNU C Library supports two interfaces for matching regular
  5942. expressions. One is the standard POSIX.2 interface, and the other is
  5943. what the GNU C Library has had for many years.
  5944. Both interfaces are declared in the header file ‘regex.h’. If you
  5945. define ‘_POSIX_C_SOURCE’, then only the POSIX.2 functions, structures,
  5946. and constants are declared.
  5947. * Menu:
  5948. * POSIX Regexp Compilation:: Using ‘regcomp’ to prepare to match.
  5949. * Flags for POSIX Regexps:: Syntax variations for ‘regcomp’.
  5950. * Matching POSIX Regexps:: Using ‘regexec’ to match the compiled
  5951. pattern that you get from ‘regcomp’.
  5952. * Regexp Subexpressions:: Finding which parts of the string were matched.
  5953. * Subexpression Complications:: Find points of which parts were matched.
  5954. * Regexp Cleanup:: Freeing storage; reporting errors.
  5955. 
  5956. File: libc.info, Node: POSIX Regexp Compilation, Next: Flags for POSIX Regexps, Up: Regular Expressions
  5957. 10.3.1 POSIX Regular Expression Compilation
  5958. -------------------------------------------
  5959. Before you can actually match a regular expression, you must “compile”
  5960. it. This is not true compilation--it produces a special data structure,
  5961. not machine instructions. But it is like ordinary compilation in that
  5962. its purpose is to enable you to "execute" the pattern fast. (*Note
  5963. Matching POSIX Regexps::, for how to use the compiled regular expression
  5964. for matching.)
  5965. There is a special data type for compiled regular expressions:
  5966. -- Data Type: regex_t
  5967. This type of object holds a compiled regular expression. It is
  5968. actually a structure. It has just one field that your programs
  5969. should look at:
  5970. ‘re_nsub’
  5971. This field holds the number of parenthetical subexpressions in
  5972. the regular expression that was compiled.
  5973. There are several other fields, but we don't describe them here,
  5974. because only the functions in the library should use them.
  5975. After you create a ‘regex_t’ object, you can compile a regular
  5976. expression into it by calling ‘regcomp’.
  5977. -- Function: int regcomp (regex_t *restrict COMPILED, const char
  5978. *restrict PATTERN, int CFLAGS)
  5979. Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap lock dlopen
  5980. | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety Concepts::.
  5981. The function ‘regcomp’ "compiles" a regular expression into a data
  5982. structure that you can use with ‘regexec’ to match against a
  5983. string. The compiled regular expression format is designed for
  5984. efficient matching. ‘regcomp’ stores it into ‘*COMPILED’.
  5985. It's up to you to allocate an object of type ‘regex_t’ and pass its
  5986. address to ‘regcomp’.
  5987. The argument CFLAGS lets you specify various options that control
  5988. the syntax and semantics of regular expressions. *Note Flags for
  5989. POSIX Regexps::.
  5990. If you use the flag ‘REG_NOSUB’, then ‘regcomp’ omits from the
  5991. compiled regular expression the information necessary to record how
  5992. subexpressions actually match. In this case, you might as well
  5993. pass ‘0’ for the MATCHPTR and NMATCH arguments when you call
  5994. ‘regexec’.
  5995. If you don't use ‘REG_NOSUB’, then the compiled regular expression
  5996. does have the capacity to record how subexpressions match. Also,
  5997. ‘regcomp’ tells you how many subexpressions PATTERN has, by storing
  5998. the number in ‘COMPILED->re_nsub’. You can use that value to
  5999. decide how long an array to allocate to hold information about
  6000. subexpression matches.
  6001. ‘regcomp’ returns ‘0’ if it succeeds in compiling the regular
  6002. expression; otherwise, it returns a nonzero error code (see the
  6003. table below). You can use ‘regerror’ to produce an error message
  6004. string describing the reason for a nonzero value; see *note Regexp
  6005. Cleanup::.
  6006. Here are the possible nonzero values that ‘regcomp’ can return:
  6007. ‘REG_BADBR’
  6008. There was an invalid ‘\{...\}’ construct in the regular expression.
  6009. A valid ‘\{...\}’ construct must contain either a single number, or
  6010. two numbers in increasing order separated by a comma.
  6011. ‘REG_BADPAT’
  6012. There was a syntax error in the regular expression.
  6013. ‘REG_BADRPT’
  6014. A repetition operator such as ‘?’ or ‘*’ appeared in a bad position
  6015. (with no preceding subexpression to act on).
  6016. ‘REG_ECOLLATE’
  6017. The regular expression referred to an invalid collating element
  6018. (one not defined in the current locale for string collation).
  6019. *Note Locale Categories::.
  6020. ‘REG_ECTYPE’
  6021. The regular expression referred to an invalid character class name.
  6022. ‘REG_EESCAPE’
  6023. The regular expression ended with ‘\’.
  6024. ‘REG_ESUBREG’
  6025. There was an invalid number in the ‘\DIGIT’ construct.
  6026. ‘REG_EBRACK’
  6027. There were unbalanced square brackets in the regular expression.
  6028. ‘REG_EPAREN’
  6029. An extended regular expression had unbalanced parentheses, or a
  6030. basic regular expression had unbalanced ‘\(’ and ‘\)’.
  6031. ‘REG_EBRACE’
  6032. The regular expression had unbalanced ‘\{’ and ‘\}’.
  6033. ‘REG_ERANGE’
  6034. One of the endpoints in a range expression was invalid.
  6035. ‘REG_ESPACE’
  6036. ‘regcomp’ ran out of memory.