File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / readline / doc / history.dvi
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jul 30 08:16:46 2014 UTC (9 years, 11 months ago) by misho
Branches: readline, MAIN
CVS tags: v6_3p10_cross, v6_3p10, v6_3, p6, HEAD
readline 6.3

; TeX output 2014.02.11:165733GJNjcmbx12JGNUqHistoryLibraryG0@6K`y
3
cmr10Editionf6.3,for7<x
3
cmtt10HistoryLibraryVeersion6.3.
qJan!uaryf2014z\Nffcmbx12\ChetffRameyf,CaseWesternReserveUniversityBrianffFfox,FreeSoftwareffFoundation̉*33fhGThisdoMcumen!tdescribestheGNUړHistorylibrary(v!ersion6.3,6January2014),aprogram-
33GmingtoMolthatpro!videsaconsisten!tuserinterfaceforrecallinglinesofpreviouslyt!ypMedGinput.33GCop!yrightcf?!",
3
cmsy10
@1988{2014fFereeSoft!warefFoundation,Inc..P!ermissiont#ist"grantedtot"copye,ddistributeand/ort#moMdifythisdoMcumen!tunderthe
33.terms
~oftheGNU
WFereeDoMcumen!tationLicense,)Version1.3oran!ylaterversion.published^b!ytheFereeSoftwareFeoundation;;<withnoInvdDariantSections,no.Feron!t-CoverxfTexts,andxenoBac!k-CoverTeexts.ΈAxZcopyxfofthelicenseisincluded.infthesectionen!titled\GNUFereeDoMcumentationLicense".ۍTi33͍GSNGcmbx12STaGablezofConutents)33G\132UsingffHistoryInteractively32cgffcmmi12c:Q32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:
}s\1!G1.1
5HistoryfExpansion;>b>
3
cmmi10:ۍ::::::::::::::::::::::::::::::::::::::::::::
31
330G1.1.1
5Ev!entfDesignatorsč:ۍ::::::::::::::::::::::::::::::::::::::::	h10G1.1.2
5WeordfDesignators:ۍ::::::::::::::::::::::::::::::::::::::::
;920G1.1.3
5MoMdiersw΍:ۍ:::::::::::::::::::::::::::::::::::::::::::::::::233G\232ProgrammingffwithGNUHistory䯍32c:Q32:32:32:32:32:32:32:32:32:32:32:32:\4!G2.1
5In!troMductionftoHistory2@:ۍ::::::::::::::::::::::::::::::::::::::::x4!G2.2
5HistoryfStorageސ:ۍ:::::::::::::::::::::::::::::::::::::::::::::::
b4!G2.3
5HistoryfFeunctionsyS:ۍ:::::::::::::::::::::::::::::::::::::::::::::	50G2.3.1
5InitializingfHistoryandStateManagemen!tP:ۍ::::::::::::::::50G2.3.2
5HistoryfListManagemen!t\s:ۍ:::::::::::::::::::::::::::::::::50G2.3.3
5InformationfAbMouttheHistoryList[:ۍ:::::::::::::::::::::::	*60G2.3.4
5Mo!vingfAroundtheHistoryList>:ۍ::::::::::::::::::::::::::	xv60G2.3.5
5Searc!hingftheHistoryList8:ۍ::::::::::::::::::::::::::::::::	o70G2.3.6
5ManagingftheHistoryFile:ۍ::::::::::::::::::::::::::::::::	6P70G2.3.7
5HistoryfExpansion5:ۍ::::::::::::::::::::::::::::::::::::::::8!G2.4
5HistoryfVeariablesQp:ۍ::::::::::::::::::::::::::::::::::::::::::::::ը8!G2.5
5HistoryfProgrammingExample:ۍ:::::::::::::::::::::::::::::::	'Q1033G\Apps3endixffA|(GNUffFfreeDos3cumentationLicense4w32c:Q32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:
3\12 GApps3endixffB|(ConceptffIndex[32c:Q32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:32:
X\20GApps3endixffC|(FfunctionffandVariableIndexA32c:Q32:32:32:\21GChapterf1:UsingHistoryIn!teractivelyc133͍GS1	QUsingzHistoryInuteractively^GThisc!hapterdescribMeshowtousethe<-
3
cmcsc10gnuHistoryLibraryin!teractivelye,zfromauser's
33GstandpMoin!t.	Itpshouldbeoconsideredauser'sguide.	FeorinformationonusingthegnuGHistory5Libraryiny!ourownprograms,YseeChapter2[ProgrammingwithGNU5History],Gpagef4.G\1.1Historyf@Expansion33GThepHistorylibrarypro!videspahistoryexpansionfeaturethatissimilartothehistoryGexpansionepro!videdbycsh.
ThissectiondescribMesthesyntaxeusedtomanipulatetheGhistoryfinformation.U!GHistory3expansionsin!troMducewordsfromthehistorylistintotheinputstream,makingGitdeasytocrepMeatcommands,einserttheargumen!tstoapreviouscommandin!tothecurrentGinputfline,orxerrorsinpreviouscommandsquic!klye.V!GHistoryg
expansiontak!esplaceintwoparts.TherstistodeterminewhichlinefromGthehistorylistshouldbMeusedduringsubstitution.ѠThesecondistoselectpMortionsofGthatlineforinclusionin!tothecurrentone.ThelineselectedfromthehistoryiscalledtheG:p0J
3
cmsl10ev!ent,WandDSthepMortionsDRofthatlinethatareactedupMonarecalledw!ords.,VeariousmoMdiersGare-a!vdDailabletomanipulatetheselectedwords.3ThelineisbrokenintowordsinthesameGfashionthatBashdoMes,sothatsev!eralwordssurroundedbyquotesareconsideredonew!ord.GHistorykexpansionskarein!troMducedbyktheappMearanceofthehistoryexpansionc!haracter,Gwhic!hfis`!'bydefault."GeN
#cmbx12e1.1.1d(EventMDesignators3GAnev!entdesignatorisareferencetoacommandlineen!tryinthehistorylist.,UnlesstheGreferencefisabsolute,ev!entsfarerelativ!etothecurrentpMositioninthehistorylist.H獑G!4IStartahistorysubstitution,Texceptwhenfollo!wedbyaspace,Stab,theendofK:thefline,or`='.VG!=<x
3
cmsltt10n.QReferftocommandlinen.UG!-n(Referftothecommandnlinesbac!k.G!!.QReferftothepreviouscommand.Thisisasynon!ymfor`!-1'.G!stringMRefertothemostrecen!tcommandprecedingthecurren!tpMositioninthehistory
33K:listfstartingwithstring.G!?string[?]K:Refertothemostrecen!tcommandprecedingthecurren!tpMositioninthehistoryK:list/con!taining0string.a9Thetrailing`?'ma!ybMeomittedifthestringHisfollo!wedK:immediatelyfb!yanewline.UG^string1^string2^K:Quic!kHSubstitution.[RepMeatthelastcommand,replacingstring1withstring2.K:EquivdDalen!tfto!!:s/string1/string2/.G!#.QThefen!tirecommandlinetypMedsofar.!hGChapterf1:UsingHistoryIn!teractivelyc233͍Ge1.1.2d(WģordMDesignators3GWeordA[designatorsareusedtoselectdesiredAZw!ordsfromtheevent./AAA`:'separatestheevent
33GspMecicationm6fromthew!orddesignator.2MItmaybMeomittediftheworddesignatorbMeginsGwith<a=`^',`$',`*',`-',or`%'.$Weords=aren!umbMeredfrom=thebeginningofthe=line,withtheGrstAw!ordbMeing@denotedby0(zero).Weords@areinsertedintothecurrent@lineseparatedbyGsinglefspaces.!GFeorfexample,'G!!.QdesignatesP;theprecedingcommand.]Wheny!outypMethis,ztheprecedingcom-K:mandfisrepMeatedintoto.G!!:$"Kdesignates_thelastargumen!t^oftheprecedingcommand.ThismaybMeshortenedK:tof!$.G!fi:2designatesthesecondargumen!tofthemostrecen!tcommandstartingwiththeK:lettersffi.(!GHerefarethew!orddesignators:G0f(zero)
The0thw!ord.Feormanyapplications,thisisthecommandword.Gn4IThefnthw!ord.G^4IThefrstargumen!t;thatis,word1.G$4ITheflastargumen!t.G%4IThefw!ordmatchedbythemostrecent`?string?'search.Gx-y(Afrangeofw!ords;`-y'abbreviates`0-y'.G*4IAllRofthew!ords,cexcepttheR0th.	Thisisasynon!ymfor`1-$'.
Itisnotanerror
33K:touse`*'ifthereisjustonew!ordintheev!ent;1theemptystringisreturnedinK:thatfcase.Gx*.QAbbreviatesf`x-$'Gx-.QAbbreviatesf`x-$'lik!e`x*',butomitsthelastword.'!GIf[aZw!orddesignatorissuppliedwithoutanev!entspMecication,-Xtheprevious[commandGisfusedastheev!ent.NGe1.1.3d(Moidiers3GAfterntheoptionalw!orddesignator,yyoucanaddasequenceofoneormoreofthefollowingGmoMdiers,feac!hprecededbya`:'.(Gh4IRemo!vefatrailingpathnamecompMonen!t,leavingonlythehead.Gt4IRemo!vefallleadingpathnamecompMonen!ts,leavingthetail.Gr4IRemo!vefatrailingsuxoftheform`.suffix',lea!vingthebasename.Ge4IRemo!vefallbutthetrailingsux.Gp4IPrin!tfthenewcommandbutdonotexecuteit..GChapterf1:UsingHistoryIn!teractivelyc333͍Gs/old/new/
33K:SubstitutenewږfortherstoMccurrence~ofoldXintheev!entline.'AnydelimiterK:ma!ybMeusedinplaceof`/'.^Thedelimiterma!ybMequotedinoldh;andnewwithaK:single`bac!kslash.ƖIf``&'appMearsinnew,nitisreplacedb!yold.ƕA`singlebackslashK:will)quote)the`&'.h}Thenaldelimiterisoptionalifitisthelastc!haracteronK:thefinputline.33G&4IRepMeatftheprevioussubstitution.Gg
33Ga4ICausec!hangestobMeappliedovertheentireeventline.صUsedinconjunctionK:withf`s',asings/old/new/,orwith`&'.33GG4IApplyfthefollo!wing`s'moMdieroncetoeachwordintheevent.9,GChapterf2:ProgrammingwithGNUHistory5433͍GS2	QProgrammingzwithGNUHistoryQGThisc!hapterdescribMeshowtointerfaceprogramsthatyouwritewiththegnuHistory
33GLibrarye.3ItshouldbMeconsideredatec!hnicalguide.4Forinformationonthein!teractiveuseGoffgnuHistorye,seeChapter1[UsingHistoryIn!teractively],fpage1.ٍG\2.1Intros3ductionf@toHistory33GMan!y@programsread?inputfromtheuseralineatatime.{ThegnuHistorylibraryisableGtotk!eeptrackofthoselines,~assoMciatetarbitrarydatawitheachline,~andutilizeinformationGfromfpreviouslinesincompMosingnewones.!GTheMprogrammerMusingtheHistorylibraryhasa!vdDailablefunctionsforremem!bMeringlinesGonzGazHhistorylist,MassoMciatingarbitrarydatawithaline,Mremo!vinglinesfromthelist,Msearc!hingGthrough<thelist<foralinecon!taininganarbitrarytextstring,b	andreferencingan!ylineinGthelistdirectlye.xInaddition,ahistoryexpansionfunctionisa!vdDailablewhichprovidesforaGconsisten!tfuserinterfaceacrossdierentprograms.!GTheYuserYusingprogramswrittenwiththeHistorylibraryhasthebMenetofaconsisten!tGuserVin!terfaceUwithasetofw!ell-knowncommandsVformanipulatingthetextofpreviousGlinesOCandusingthattextinnewcommands.ThebasichistorymanipulationcommandsareGsimilarftothehistorysubstitutionpro!videdbycsh.!GIftheprogrammerdesires,hecanusetheReadlinelibrarye,whic!hincludessomehistoryGmanipulationfb!ydefault,andhastheaddedadvdDantageofcommandlineediting.!GBeforedeclaringan!yfunctionsusinganyfunctionalitytheHistorylibraryprovidesinGotherrJcoMde,|anapplicationrIwritershouldincludethele<readline/history.h>inan!yleGthat?uses>theHistorylibrary'sfeatures.{Itsuppliesexterndeclarationsforallofthelibrary'sGpublicffunctionsandvdDariables,anddeclaresallofthepublicdatastructures.ٍG\2.2Historyf@Storage33GThefhistorylistisanarra!yofhistoryentries.Ahistoryentryisdeclaredasfollows:.typedefvoid*histdata_t;ff.typedefstruct_hist_entry{:xchar*line;:xchar*timestamp;:xhistdata_tdata;.}HIST_ENTRY;!GThefhistorylistitselfmigh!tthereforebMedeclaredas.HIST_ENTRY**the_history_list;!GThefstateoftheHistorylibraryisencapsulatedin!toasinglestructure:./*
334F*Astructureusedtopassaroundthecurrentstateofthehistory.4F*/.typedefstruct_hist_state{:xHIST_ENTRY**entries;/*Pointertotheentriesthemselves.*/:xintoffset;?<N/*Thelocationpointerwithinthisarray.*/<GChapterf2:ProgrammingwithGNUHistory5533͍:xintlength;?<N/*Numberofelementswithinthisarray.*/
33:xintsize;J/*Numberofslotsallocatedtothisarray.*/:xintflags;.}HISTORY_STATE;y"!GIffthe
agsmem!bMerincludesHS_STIFLED,thehistoryhasbeensti
ed.h捍G\2.3Historyf@Ffunctions33GThissectiondescribMesthecallingsequenceforthevdDariousfunctionsexpMortedb!ythegnuGHistoryflibrarye.EGe2.3.1d(InitializingMHistoryandStateManagement3GThisQsectiondescribMesfunctionsRusedtoinitializeandmanagethestateoftheHistorylibraryGwhenfy!ouwanttousethehistoryfunctionsinyourprogram.z[Feunction]G@<x
cmtt10@voidLusing_historyy;m#R
3
cmss10(v!oid).Beginasessioninwhic!hthehistoryfunctionsmigh!tbMeused.KThisinitializesthe.in!teractivefvdDariables.z[Feunction]G@HISTORY_STATEL*history_get_history_statey(v!oid).Returnfastructuredescribingthecurren!tstateoftheinputhistorye.z[Feunction]G@voidLhistory_set_history_statey(HISTOReY>xHtSTATEf*state).Setfthestateofthehistorylistaccordingtostate.EGe2.3.2d(HistoryMListManagement3GTheseUfunctionsVmanageindividualen!triesonthehistorylist,orsetparametersmanagingGtheflistitself.z[Feunction]G@voidLadd_historyy(constfc!har*string).Placestringattheendofthehistorylist.ٲTheassoMciateddataeld(ifan!y)issetto.NULL.z[Feunction]G@voidLadd_history_timey(constfc!har*string).ChangefthetimestampassoMciatedwiththemostrecen!thistoryentrytostring.z[Feunction]G@HIST_ENTRYL*remove_historyy(in!tfwhich).Remo!vexDhistoryen!tryatosetwhichfromxEthehistorye.
SwTheremovedelementis.returnedfsoy!oucanfreetheline,data,andcontainingstructure.z[Feunction]G@histdata_tLfree_history_entryy(HIST>xHtENTReYf*histen!t).Feree[thehistoryen!tryhistentandany[historylibraryprivdDatedataassoMciatedwithit..Returnsftheapplication-spMecicdatasothecallercandisposeofit.z[Feunction]G@HIST_ENTRYL*replace_history_entryy(in!tfwhich,constchar*line,DGhistdata>xHttfdata).Mak!ePthehistoryentryatosetwhichhavelineandPdata.UThisreturnstheoldentry.sou
thecallercandispMoseofan!yapplication-specicdata.IInthecaseofanin!vdDalid.whic!h,faNULLpMointerisreturned.IGChapterf2:ProgrammingwithGNUHistory5633͍z[Feunction]G@voidLclear_historyy(v!oid)
33.Clearfthehistorylistb!ydeletingalltheentries.fgz[Feunction]G@voidLstifle_historyy(in!tfmax).Sti
efthehistorylist,remem!bMeringonlythelastmaxgentries.z[Feunction]G@intLunstifle_historyy(v!oid).StopHsti
ingthehistorye.Thisreturnsthepreviously-setmaxim!umnumbMerofhistory.en!tries7
(as7setbystifle_history()).ThevdDalue7ispMositive7ifthehistoryw!assti
ed,.negativ!efifitwasn't.ffz[Feunction]G@intLhistory_is_stifledy(v!oid).Returnsfnon-zeroifthehistoryissti
ed,zeroifitisnot.Ge2.3.3d(InformationMAbiouttheHistoryList3GTheseffunctionsreturninformationabMouttheen!tirehistorylistorindividuallistentries.z[Feunction]G@HIST_ENTRYL**history_listy(v!oid).ReturnhaNULLterminatedarra!yofiHIST_ENTRYf*whichisthecurrentinputhistorye..Elemen!tf0ofthislististhebMeginningoftime.Ifthereisnohistorye,returnNULL.z[Feunction]G@intLwhere_historyy(v!oid).Returnsftheosetofthecurren!thistoryelement.ffz[Feunction]G@HIST_ENTRYL*current_historyy(v!oid).Returnthehistoryen!tryatthecurrentpMosition,asdeterminedbywhere_history()..Iffthereisnoen!trythere,returnaNULLpMointer.z[Feunction]G@HIST_ENTRYL*history_gety(in!tfoset).Returnthehistoryen!tryatpMositionoset,Tstartingfromhistory_base(seeSec-.tion2.4[HistoryVeariables],ipage8).uIfthereisnoen!trythere,iorifosetisgreater.thanfthehistorylength,returnaNULLpMoin!ter.z[Feunction]G@time_tLhistory_get_timey(HIST>xHtENTReYf*en!try).ReturnfthetimestampassoMciatedwiththehistoryen!tryentry.z[Feunction]G@intLhistory_total_bytesy(v!oid).ReturnPHthePIn!umbMerofbytesthatPItheprimaryhistoryen!triesareusing.)Thisfunction.returnsfthesumofthelengthsofallthelinesinthehistorye.Ge2.3.4d(MovingMAroundtheHistoryList3GTheseffunctionsallo!wthecurrentindexintothehistorylisttobMesetorchanged.ffz[Feunction]G@intLhistory_set_posy(in!tfpMos).Setfthefcurren!thistoryosettopMos,anabsoluteindexin!tothelist.Returns1on.success,f0ifpMosislessthanzeroorgreaterthanthen!umberfofhistoryen!tries.z[Feunction]G@HIST_ENTRYL*previous_historyy(v!oid).Bac!kuuputhecurrenthistoryuosettotheprevioushistoryen!trye,fandreturnapMoin!ter.tofthaten!trye.Ifthereisnopreviousentrye,returnaNULLpMointer.U΍GChapterf2:ProgrammingwithGNUHistory5733͍z[Feunction]G@HIST_ENTRYL*next_historyy(v!oid)
33.Mo!veE1thecurren!tE2historyosetforwardtoE2thenexthistoryentrye,landE2returnthea.pMoin!terftothatentrye.Ifthereisnonextentrye,returnaNULLpMointer.Ge2.3.5d(SearchingMtheHistoryList3GThese]functionsallo!wsearchingofthehistorylistforentriescontainingaspMecicstring.GSearc!hingLmayLbMeperformedLbothforw!ardLandbackwardfromLthecurrentLhistorypMosition.GThesearc!hmaybMeanchored,meaningthatthestringmustmatchatthebMeginningoftheGhistoryfen!trye.Pvz[Feunction]G@intLhistory_searchy(constfc!har*string,intdirection).Searc!hwSthehistorywRforstring,startingatthecurren!thistoryoset.,Ifdirectionisless.thanY0,thentheXsearc!histhroughpreviousen!tries,otherwisethroughsubsequen!t.en!tries.Ifstring2isfound,thenthecurrenthistoryindexissettothathistoryen!trye,.andthevdDaluereturnedistheosetinthelineoftheen!trywherestringwasfound..Otherwise,fnothingisc!hanged,anda-1isreturned.z[Feunction]G@intLhistory_search_prefixy(constfc!har*string,intdirection).Searc!h2the1historyforstring,-dstartingatthecurren!thistoryoset.@Thesearc!his.anc!hored:ΤmatchinglinesmustbMeginwithstring.ӷIfdirectionislessthan0,
thenthe.searc!histhroughpreviousentries,otherwisethroughsubsequententries.0RIfstringis.found,thenathebcurren!thistoryindexissettothaten!trye,andthereturnvdDalueis0..Otherwise,fnothingisc!hanged,anda-1isreturned.z[Feunction]G@intLhistory_search_posy(constfc!har*string,intdirection,intpMos).Searc!hforstringinthehistorylist,:sstartingatpMos,anabsoluteindexin!tothelist..IfTdirectionTisnegativ!e,mthesearchTproMceedsbackwardTfrompMos,motherwiseforward..ReturnsJstheabsoluteindexofJrthehistoryelemen!twherestring:wasfound,uor-1.otherwise.Ge2.3.6d(ManagingMtheHistoryFile3GThe1Historylibrary1canreadthehistoryfromandwriteittoale.ThissectiondoMcumen!tsGtheffunctionsformanagingahistoryle.z[Feunction]G@intLread_historyy(constfc!har*lename).Addgthefcon!tentsoflename+mtothehistorylist,3alinefatatime.IflenameisNULL,.thenfreadfrom~/.history.Returns0ifsuccessful,orerrnoifnot.z[Feunction]G@intLread_history_rangey(constfc!har*lename,intfrom,intto).ReadYarangeYoflinesfromlename,haddingthemtothehistorylist.Startreadingat.line&=fromandend&>atto.%Iffromiszero,?startatthebMeginning.Iftoislessthanfrom,.thenreadun!tiltheendofthele.׫IflenameisNULL,|thenreadfrom~/.history..Returnsf0ifsuccessful,orerrnoifnot.z[Feunction]G@intLwrite_historyy(constfc!har*lename).Werite#%thecurren!thistoryto#$lename,BUoverwritinglename,if#$necessarye.TIflename.isBNULL,VthenBwritethehistorylistto~/.history.Returns0onsuccess,Vorerrnoon.afreadorwriteerror.cGChapterf2:ProgrammingwithGNUHistory5833͍z[Feunction]G@intLappend_historyy(in!tfnelements,constchar*lename)
33.AppMend)thelast)nelemen!tsofthehistorylisttolename.g1IflenameƉisNULL,JIthen.appMendfto~/.history.Returns0onsuccess,orerrnoonareadorwriteerror.u1z[Feunction]G@intLhistory_truncate_filey(constfc!har*lename,intnlines).Teruncatethehistorylelename,@lea!vingonlythelastnlinesclines.OIflename<is.NULL,fthen~/.historyistruncated.Returns0onsuccess,orerrnoonfailure. Ge2.3.7d(HistoryMExpansion3GTheseffunctionsimplemen!thistoryexpansion.u2z[Feunction]G@intLhistory_expandy(c!harf*string,char**output).Expand!)string,?placingtheresultin!tooutput,?a!(pMointertoastring(seeSection1.1.[HistoryfIn!teraction],page1).Returns:d.04IIfnoexpansionstoMokplace(or,iftheonlyc!hangeinthetextw!asthehʏremo!vdDalwofxescapMecharacterswprecedingthexhistoryexpansionc!haracter);T2.14Iiffexpansionsdidtak!eplace;.-1.Qifftherew!asanerrorinexpansion;.24IifO$theO#returnedlineshouldbMedispla!yed,`butO$notexecuted,asO$withthe:p
33hʏmoMdierf(seeSection1.1.3[Modiers],page2)..IffanerroroMccurredinexpansion,thenoutputfcon!tainsadescriptiveerrormessage.u1z[Feunction]G@charL*get_history_eventy(constfc!har*string,int*cindex,intqchar).Returnsvthetextofvthehistoryev!entvbMeginningatstringg+*cindex.
O*cindex8Wis.moMdiedtopoin!ttoaftertheeventspMecier.Atfunctionentrye,cindexFnpMointstothe.indexNin!toNstring>wherethehistoryev!entspMecicationbegins.Vqc!harisNacharacter.that:Xisallo!wed:Xtoendtheev!ent:YspMecication:Xinadditiontothe\normal"terminating.c!haracters.z[Feunction]G@charL**history_tokenizey(constfc!har*string).Returnanarra!yoftokensparsedoutofstring,[muchastheshellmight._Thetokens.are6split7onthec!haractersinthehistory>xHtw!ord>xHdelimitersvdDariable,jandshell6quoting.con!ventionsfareobMey!ed.u2z[Feunction]G@charL*history_arg_extracty(in!tfrst,intlast,constchar*string).ExtractHaGstringsegmen!tconsistingoftherstGthroughlastHargumen!tspresentHin.string.Argumen!tsfaresplitusinghistory_tokenize.1~G\2.4Historyf@Vfariables33GThis:sectiondescribMestheexternally-visiblevdDariablesexportedb!ythegnuHistoryLibrarye.3[Veariable]G@intLhistory_base.Theflogicalosetofthersten!tryinthehistorylist.u13[Veariable]G@intLhistory_length.Thefn!umbMerofentriescurrentlystoredinthehistorylist.	rGChapterf2:ProgrammingwithGNUHistory5933͍3[Veariable]G@intLhistory_max_entries
33.TheZmaxim!umYnumbMerofhistoryYentries.
zThismustZbMec!hangedusingstifle_.history().M3[Veariable]G@intLhistory_write_timestamps.If\non-zero,timestamps\arewrittentothehistoryle,sotheycanbMepreserv!ed.bMet!weenfsessions.ThedefaultvdDalueis0,meaningthattimestampsarenotsa!ved.@.Thecurren!ttimestampformatusesthevdDalueofhistory>xHtcomment>xHchar#todelimit.timestampen!triesinthehistoryle.	+IfthatvdDariabledoMesnotha!veavdDalue(the.default),ftimestampswillnotbMewritten.3[Veariable]G@charLhistory_expansion_char.The;yc!haracterthatintroMduces;xahistoryevent.The;xdefaultis`!'.Setting;xthisto0.inhibitsfhistoryexpansion.3[Veariable]G@charLhistory_subst_char.The|c!haracter}thatinvokeswordsubstitution}iffoundatthestartofaline. The.defaultfis`^'.3[Veariable]G@charLhistory_comment_char.Duringtok!enization,¿ifthischaracterisseenastherstcharacterofaword,¿then.it4and4allsubsequen!tcharacters4uptoanewlineareignored,ysuppressinghistory.expansionffortheremainderoftheline.Thisisdisabledb!ydefault.L3[Veariable]G@charL*history_word_delimiters.TheMc!haractersthatMseparatetokensforhistory_tokenize().cThedefaultMvdDalueis".\t\n()<>;&|".3[Veariable]G@charL*history_search_delimiter_chars.The list ofadditionalc!haracterswhich candelimitahistorysearc!hstring,;inaddition.tofspace,TeAB,`:'and`?'inthecaseofasubstringsearc!h.Thedefaultisemptye.3[Veariable]G@charL*history_no_expand_chars.Theklistofc!haracterswhichinhibitlhistoryexpansioniffoundimmediatelyfollowing.history>xHtexpansion>xHc!har.Thefdefaultisspace,tab,newline,carriagereturn,and`='.3[Veariable]G@intLhistory_quotes_inhibit_expansion.IfWnon-zero,single-quotedXw!ordsarenotscannedforthehistoryexpansionc!haracter..ThefdefaultvdDalueis0.3[Veariable]G@rl_linebuf_func_tL*history_inhibit_expansion_function.This?should>bMesettotheaddressofafunctionthattak!estwo>arguments:acharf*.(string)0nandan0ointindexin!tothatstring(i).Itshouldreturnanon-zerovdDalueifthe.historyexpansionstartingatstring[i]shouldnotbMeperformed;zeroiftheexpansion.shouldObMePdone.mItisin!tendedforuseb!yapplicationslik!eBashthatusethehistory.expansionfc!haracterforadditionalpurpMoses.Bydefault,thisvdDariableissettoNULL.
GChapterf2:ProgrammingwithGNUHistoryл1033͍G\2.5Historyf@ProgrammingExample33GTheffollo!wingprogramdemonstratessimpleuseofthegnuHistoryLibrarye..ߤN		cmtt9#include<stdio.h>
.#include<readline/history.h>.main(argc,argv)Fintargc;Fchar**argv;.{8lcharline[1024],*t;8lintlen,done=0;8lline[0]=0;8lusing_history();8lwhile(!done)A{KS printf("history$");KS fflush(stdout);KS t=fgets(line,sizeof(line)-1,stdin);KS if(t&&*t)TL{^9xlen=strlen(t);^9xif(t[len-1]=='\n')gt[len-1]='\0';TL}KS if(!t)TLstrcpy(line,"quit");KS if(line[0])TL{^9xchar*expansion;^9xintresult;^9xresult=history_expand(line,&expansion);^9xif(result)gfprintf(stderr,"%s\n",expansion);^9xif(result<0||result==2)g{qfree(expansion);qcontinue;g}^9xadd_history(expansion);^9xstrncpy(line,expansion,sizeof(line)-1);^9xfree(expansion);TL}KS if(strcmp(line,"quit")==0)TLdone=1;KS elseif(strcmp(line,"save")==0)TLwrite_history("history_file");KS elseif(strcmp(line,"read")==0)TLread_history("history_file");KS elseif(strcmp(line,"list")==0)GChapterf2:ProgrammingwithGNUHistoryл1133͍TL{
^9xregisterHIST_ENTRY**the_list;^9xregisterinti;^9xthe_list=history_list();^9xif(the_list)gfor(i=0;the_list[i];i++)qprintf("%d:%s\n",i+history_base,the_list[i]->line);TL}KS elseif(strncmp(line,"delete",6)==0)TL{^9xintwhich;^9xif((sscanf(line+6,"%d",&which))==1)g{qHIST_ENTRY*entry=remove_history(which);qif(!entry)zfprintf(stderr,"Nosuchentry%d\n",which);qelsez{(free(entry->line);(free(entry);z}g}^9xelseg{qfprintf(stderr,"non-numericarggivento`delete'\n");g}TL}A}.}ƍGAppMendixfA:GNUFereeDocumen!tationLicense:1233͍GSApp=endixzA	QGNUzFaGreeDocumenutationLicenseAVeersionf1.3,3No!vembMerf2008Q.Cop!yrightcf
@2000,f2001,2002,2007,2008FereeSoft!warefFoundation,Inc.
33.http://fsf.org/ff.Ev!eryonefispMermittedtocop!yanddistributeverbatimcopies.offthislicensedoMcumen!t,butchangingitisnotallowed.-0.'PREAMBLE'ThevQpurpMosevRofthisLicenseistomak!eaman!ual,LtextbMook,orvQothervRfunctionaland'usefuldoMcumen!tfree;inthesenseoffreedom:!toassureev!eryonetheeectivefreedom'to9cop!y:andredistributeit,.withorwithoutmoMdifyingit,.eithercommerciallyornon-'commerciallye.cSecondarily,Hthis(aLicense(bpreserv!esfortheauthorandpublisheraw!ay'toW9getcreditW8fortheirw!ork,mwhilenotbMeingconsideredrespMonsibleformodications'madefb!yothers.'This/License0isakindof\cop!yleft",which/meansthatderivdDativ!eworksof0thedoMcument'm!ustthemselvesbMefreeinthesamesense. Itcomplemen!tstheGNUGeneralPublic'License,fwhic!hisacopyleftlicensedesignedforfreesoftware.'Wee#ha!vedesignedthisLicenseinordertouseit"formanualsforfreesoftware,bMecause'free?soft!wareneedsfree>doMcumentation:afreeprogramshould>comewithmanuals'pro!vidingurtheussamefreedomsthatthesoft!wareurdoMes.͌ButthisLicenseisnotlimitedto'soft!waremanuals;itcanbMeusedforan!ytextualw!ork,regardlessofsubjectmatteror'whether2itispublishedasaprin!tedbMook.@BWee2recommendthisLicenseprincipallyfor'w!orksfwhosepurpMoseisinstructionorreference.-1.'APPLICABILITYfANDDEFINITIONSP'This>License=appliestoan!ymanual=orotherwork,inany=medium,thatcontains>a'noticeplacedb!ythecop!yrightholdersayingitcanbMedistributedundertheterms'ofthisLicense.l=Suc!hanoticegrantsaworld-wide,
royalty-freelicense,unlimitedin'duration,
toouseothatw!orkundertheconditionsstatedherein.
9The\DoMcumen!t",'bMelo!w,tkrefersgtoanysuchgmanualorwork.
AnymembMerofthegpublicisalicensee,tkand'isaddressedas\y!ou".@Yeouacceptthelicenseifyoucopye, moMdifyordistributethework'infaw!ayfrequiringpMermissionundercop!yrightflaw.'A\MoMdiedVeersion"oftheDocumen!tmeansanyworkcontainingtheDoMcumentor'ahpMortiongofit,heithercopiedv!erbatim,horwithmoMdicationsand/ortranslatedin!to'anotherflanguage.'A\SecondarySection"isanamedappMendixorafron!t-mattersectionoftheDoMcumen!t'that/dealsexclusiv!ely0withtherelationshipofthepublishersorauthorsoftheDoMcumen!t'toz
thezDoMcumen!t'soverallzsubject(ortorelatedmatters)andcon!tainsnothingthat'couldخfallدdirectlywithinthato!verallsubject.t(Thus,%@iftheخDoMcumentisinدparta'textbMookՆofՅmathematics,MaSecondarySectionma!ynotexplainan!ymathematics.)=The'relationshipGcouldbMeamatterofhistoricalconnectionwiththesubjectorwithrelated'matters,jorBofBlegal,commercial,jphilosophical,ethicalorpMoliticalBpositionregarding'them.'Ther\In!vdDariantsSections"arecertainSecondarySectionswhosetitlesaredesignated,0as'bMeing2Dthose2CofIn!vdDariant2DSections,I}inthenoticethatsa!ysthattheDoMcumen!tisreleased
GAppMendixfA:GNUFereeDocumen!tationLicense:1333͍'underS5thisLicense."IfS4asectiondoMesnotttheabMo!veS5denitionofSecondarythenitis
33'notӍallo!wedtoӎbMedesignatedasInvdDariant.eSTheDoMcumentmayӎcontainzeroInvdDariant'Sections.IftheDoMcumen!tdoesnotiden!tifyanyInvdDariantSectionsthentherearenone.&g'Thef\Co!verfTeexts"arecertainshortpassagesoftextthatarelisted,asFeron!t-Cover'Teexts-orBac!k-Cover,Texts,"8in-thenoticethat,sa!ysthattheDoMcument,isreleasedunder'thisLicense.AAnFeron!t-CoverTeextmaybMeatmost5words,6andaBack-CoverTeextmay'bMefatmost25w!ords.&h'AC\Teransparen!t"CcopyofCtheDoMcumentmeansaCmachine-readablecopye,k(represented'inJmaformatJnwhosespMecicationisa!vdDailabletothegeneralpublic,snthatissuitablefor'revisingthedoMcumen!tstraightforwardlywithgenerictexteditorsor(forimagescom-'pMosedofpixels)genericpain!tprogramsor(fordra!wings)somewidelya!vdDailabledrawing'editor,and}thatissuitableforinputto}textformattersorforautomatictranslationto'a9OvdDariet!yof9Nformatssuitableforinputtotextformatters.A93cop!ymadeinanotherwise'Teransparen!tleformatwhosemarkup,orabsenceofmarkup,hasbMeenarrangedto'th!wart0or0discouragesubsequen!tmoMdicationb!yreadersisnotTeransparen!t.Animage'format isnotTeransparen!tifused foranysubstantialamountoftext.MA copythatis'notf\Teransparen!t"iscalled\Opaque".'ExamplescXofsuitablecWformatsforTeransparen!tcopiesincludeplainasci>Kiwithout'markup,TeexinfoXIinputformat,LaT,[wEB	XXJinputformat,K`y

cmr10SGMLorXJXMLusingapublicly'a!vdDailableDTD,andstandard-conformingsimpleHTML,P!ostScriptorPDFdesigned'for.h!umanmoMdication.4ExamplesoftransparentimageformatsincludePNG,ԟXCF'andJPG.OpaqueformatsincludeproprietaryformatsthatcanbMereadandedited'onlysb!ysproprietarywordsproMcessors,&JSGMLorXMLforwhic!htheDTDand/or'proMcessingW*toolsarenotW)generallya!vdDailable,CYandthemachine-generatedHTML,'P!ostScriptforPDFproMducedbysomewordproMcessorsforoutputpurposesonlye.'The\TitleP!age"means,<foraprin!tedbMook,<thetitlepageitself,<plussuc!hfollowing'pagesRasareneededtohold,c}legiblye,theRmaterialthisRLicenserequirestoappMearinthe'title1.page.Feorw!orks1-informatswhic!hdonotha!ve1.anytitle1.pageassuc!h,H\TitlePage"'meansthetextnearthemostprominen!tappMearanceofthew!ork'stitle,Xprecedingthe'bMeginningfofthebodyofthetext.'The)\publisher"means)an!ypMersonorentitythatdistributes)copiesoftheDoMcument'tofthepublic.&h'Asection\En!titledXYZ"meansanamedsubunitoftheDoMcumen!twhosetitleeither'isUpreciselyUXYZUorcon!tainsXYZinparen!thesesUfollowingUtextthattranslatesXYZUin'anotherlanguage.(HereXYZstandsforaspMecicsectionnamemen!tionedbelo!w, :such'asaa\Ac!knowledgements",o/\Dedications",\Endorsemen!ts",or\History".)Teo\Preserv!e'theTitle"ofsuc!hasectionwheny!oumoMdifytheDoMcumen!tmeansthatitremainsa'sectionf\En!titledXYZ"accordingtothisdenition.'TheSuDoMcumen!tmayincludeWearrantyDisclaimersnextSvtothenoticewhichstatesthat'thisLicenseappliestotheDoMcumen!t.TheseWearrantyDisclaimersareconsideredto'bMeincludedb!yreferenceinthisLicense,butonlyasregardsdisclaimingw!arranties:'an!ynothernimplicationthattheseWearran!tyDisclaimersnmayhavenisvoidnandhasno'eectfonthemeaningofthisLicense.-2.'VERBAeTIMfCOPYING֍GAppMendixfA:GNUFereeDocumen!tationLicense:1433͍'Yeouma!ycopyanddistributetheDoMcumentinanymedium,eithercommerciallyor
33'noncommerciallye,zpro!videdthatthisLicense,thecop!yrightnotices,andthelicense'noticeKsa!yingK
thisLicenseappliestotheDoMcumen!tarereproMducedinallcopies,t7and'that1'y!ouaddno1(otherconditionswhatsoMevertothoseofthisLicense.Yeoumaynotuse'tec!hnicalmeasurestoobstructorcon!trolthereadingorfurthercop!yingofthecopies'y!oumakeordistribute.However,youmayacceptcompMensationinexchangeforcopies.'Ify!oudistributealargeenoughn!umbMerofcopiesy!oumustalsofollo!wtheconditions'infsection3."#'Yeou}ma!yalso}lendcopies,7underthesameconditionsstatedabMo!ve,8andyou}maypublicly'displa!yfcopies.-3.'COPYINGfINQUANTITY'Ify!oupublishprintedcopies(orcopiesinmediathatcommonlyha!veprintedcovers)of'the.DoMcumen!t,numbering.morethan-100,andthe.Documen!t'slicense-noticerequires'Co!verTeexts,<youmustenclosethecopiesincoversthatcarrye,<clearlyandlegibly,<all'these@Co!verTeexts:Fron!t-CoverTeextsonthefrontcover,andBack-CoverTeextson'thebac!kcover.
Bothcoversmustalsoclearlyandlegiblyiden!tifyyouasthepublisher'of,these+copies.H/Thefron!tcovermustpresent+thefulltitlewithallw!ordsofthetitle'equallyxprominen!tandyvisible.Yeoumayyaddothermaterialontheco!versxinaddition.'Cop!yingY4withY3changeslimitedY3totheco!vers,asY3longastheypreserv!ethetitleofthe'DoMcumen!tuandsatisfytheseconditions,canbetreateduasv!erbatimcopyinginother'respMects.'If|therequired}textsforeitherco!ver|aretoMov!oluminoustotlegiblye,youshouldput'therstoneslisted(asman!yastreasonably)ontheactualco!ver,andcontinuethe'restfon!toadjacentpages.""'If?|y!ou?{publishordistributeOpaquecopiesoftheDoMcumen!tnumbMering?|morethan100,'y!ou\3musteither\4includeamachine-readableTeransparentcopyalong\4witheachOpaque'cop!ye,[>or7state7inorwitheac!hOpaquecopy7acomputer-networkloMcation7fromwhich'theSgeneralRnet!work-usingpublichasRaccesstodownloadusingRpublic-standardnetwork'protoMcols=acomplete>Teransparen!tcopyoftheDoMcument,freeofaddedmaterial.cIf'y!ouusethelatteroption,youmusttakereasonablyprudentsteps,whenyoubMegin'distributionlofmOpaquecopiesinquan!titye,ӮtolensurethatthisTeransparen!tcopylwill'remainCth!usaccessibleDatthestatedloMcationuntilDatleastoneyearafterDthelasttime'y!oukdistributekanOpaquecopyk(directlyorthroughyourkagentsorretailers)kofthat'editionftothepublic.'It&Nisrequested,FHbutnotrequired,FGthaty!oucontacttheauthorsoftheDoMcumentwell'bMeforeoredistributingoan!ylargenumbMeroofcopies,ztogiv!ethemac!hancetopro!videyou'withfanupMdatedv!ersionoftheDocumen!t.-4.'MODIFICAeTIONS'Yeou*ma!ycopyand)distributeaMoMdiedVeersionoftheDoMcumen!tundertheconditions'ofsections2and3abMo!ve,]providedthatyoureleasetheMoMdiedVeersionunderprecisely'this{License,`withthe{MoMdiedVeersionllingtheroleoftheDoMcumen!t,`thus{licensing'distributionandmoMdicationoftheModiedVeersiontowhoev!erpossessesacop!yof'it.Infaddition,y!oumustdothesethingsintheMoMdiedVeersion:*A.=nUsepintheTitleP!age(andonthecovers,2ifany)atitledistinctfromthatofthe=nDoMcumen!t,+andfromthoseofpreviousversions(whichshould,+iftherewereanye,:GAppMendixfA:GNUFereeDocumen!tationLicense:1533͍=nbMelistedintheHistorysectionoftheDocumen!t).3Yeoumayusethesametitleas
33=nafpreviousv!ersioniftheoriginalpublisherofthatversiongivespMermission.+gB.=nList\ontheTitle[P!age,Zasauthors,YoneormorepMersonsoren!titiesrespMonsiblefor=nauthorship"of"themoMdicationsintheMoMdiedVeersion,<|togetherwithatleastv!e=nof߸theprincipalauthorsoftheDoMcumen!t(allofitsprincipalauthors,uifithasfewer=nthanfv!e),unlesstheyreleaseyoufromthisrequirement.+@C.=nStateontheTitlepagethenameofthepublisheroftheMoMdiedVeersion,asthe=npublisher.*D.=nPreserv!efallthecopyrightnoticesoftheDoMcument.+oE.=nAddeandappropriatecop!yrightnoticeeforyouremoMdicationsadjacentetotheother=ncop!yrightfnotices.,LF.=nInclude,hSimmediatelyXafterthecop!yrightXnotices,alicensenoticegivingthepublic=npMermissiontousetheMoMdiedVeersionunderthetermsofthisLicense,Pintheform=nsho!wnfintheAddendumbMelow.*nG.=nPreserv!eminlthatlicensenoticethefulllistsofIn!vdDariantSectionsmandrequiredCo!ver=nTeextsfgiv!enintheDoMcument'slicensenotice.*H.=nIncludefanunalteredcop!yofthisLicense./4I.=nPreserv!eچtheڇsectionEntitledڇ\History",PreserveitsڇTitle,andaddtoitanitem=nstating_at_leastthetitle,mQy!ear,newauthors,and_publisheroftheMoMdiedVeersion=nasXgiv!enonWtheTitlePage.7IfWthereisnosectionEntitled\History"WintheDoMcu-=nmen!t,O#create-eone-dstatingthetitle,O$year,O#authors,and-epublisher-doftheDoMcument=nasWgiv!enonitsTitlePage,FthenaddanitemdescribingtheMoMdiedVeersionas=nstatedfintheprevioussen!tence.-J.=nPreserv!ethenetworkloMcation,ifanye,givenintheDoMcumentforpublicaccessto=naTeransparen!tcopyoftheDoMcument,MandlikewisethenetworkloMcationsgivenin=nthë́DoMcumen!t̓forpreviousversions̓itwasbasedon.S6These̓maybMeplaced̓inthe=n\History"8section.Yeou9ma!yomitanet!work8loMcationforaw!orkthatw!aspublished=natKleastfourKy!earsbMeforetheDocumen!titself,t@oriftheoriginalKpublisherofthe=nv!ersionfitreferstogivespMermission.*K.=nFeorran!ysectionEntitled\Acknowledgements"or\Dedications",oPreservetheTitle=nof/Rthe/Qsection,G#andpreserv!einthesectionallthesubstanceandtoneofeac!hofthe=ncon!tributorfacknowledgementsand/ordedicationsgiventherein.,Q*L.=nPreserv!e?all?theInvdDariant?SectionsoftheDoMcumen!t,f/unalteredintheirtextand=ninPtheirPtitles.@Sectionn!umbMersorPtheequivdDalentParenotconsideredpartofthe=nsectionftitles.)M.=nDelete5an!ysectionEntitled4\Endorsements".JSuchasection4maynotbMeincluded=ninftheMoMdiedVeersion.*N.=nDog!notg"retitlean!yexistingsectiontobMeEn!titled\Endorsements"g"ortocon
ictin=ntitlefwithan!yInvdDariantSection.*O.=nPreserv!efanyWearrantyDisclaimers.΍'IftheMoMdiedVeersionincludesnewfron!t-mattersectionsorappMendicesthatqualify'asXSecondaryX	Sectionsandcon!tainnomaterialcopiedfromtheDoMcumen!t,gyoumayXat'y!ourkoptionldesignatesomeorallofthesesectionsasin!vdDariant.Teodokthis,addtheir̜GAppMendixfA:GNUFereeDocumen!tationLicense:1633͍'titles@tothelist@ofIn!vdDariant@SectionsintheMoMdiedVeersion'slicensenotice.These
33'titlesfm!ustbMedistinctfromanyothersectiontitles.('Yeoupma!yqaddasectionEntitledq\Endorsements",sprovideditcontainsqnothingbut'endorsemen!tsofyourMoMdiedVeersionbyvdDariousparties|forexample,Zstatementsof'pMeerD
revieworDthatthetexthasbeenDappro!vedD
byanorganizationDastheauthoritative'denitionfofastandard.('Yeouf,ma!yf-addapassageofuptov!ewordsf-asaFeron!t-Coverf,Text,sandf-apassageofup'to@25w!ords@asaBack-CoverTeext,Tto@theendofthelistofCo!ver@TeextsintheMoMdied'Veersion.+OnlyN+oneN*passageofFron!t-CoverN*TextN+andoneN*ofBac!k-CoverN+TextN*mayN+bMe'addedNb!y(orthrougharrangementsmadeby)Nanyoneentitye.IftheDoMcumentalready'includesaco!vertextforthesameco!ver,/!previouslyaddedbyyouorbyarrangement'made:b!ythesameentityyouareactingonbMehalfof,_youmay:notaddanother;but'y!ou)mayreplace*theoldone,2onexplicitpMermissionfromthepreviouspublisherthat'addedftheoldone.'The^author(s)]andpublisher(s)oftheDoMcumen!tdonotb!ythisLicensegiv!epMermission'tojusetheirknamesforpublicit!yforortoassertorimplyendorsemen!tofan!yMoMdied'Veersion.(-5.'COMBININGfDOCUMENTS'Yeouma!ycombinetheDoMcumentwithotherdoMcumen!tsreleasedunderthisLicense,'understhetermstdenedinsection4abMo!vesformodiedv!ersions,ӷprovidedsthaty!ou'include	in	thecom!binationalloftheIn!vdDariant	SectionsofalloftheoriginaldoMcumen!ts,'unmoMdied,L3and5list5themallasIn!vdDariant5Sectionsofy!ourcombined5workin5itslicense'notice,fandthaty!oupreservealltheirWearrantyDisclaimers.'The@com!binedworkneedonlycontainonecopyofthisLicense,andmultipleidentical'In!vdDariantSectionsma!ybMereplacedwithasinglecopye.BIftherearemultipleInvdDariant'Sections6with6thesamenamebutdieren!tcontents,Mmake6thetitleofeac!hsuch6section'uniquebb!ycaddingattheendofit,1"inparen!theses,1!thenameoftheoriginalauthoror'publisherofthat~sectionifkno!wn,!orelseauniquen!umbMer.Makethesameadjustmen!t'tothesectiontitlesinthelistofIn!vdDariantSectionsinthelicensenoticeofthecom!bined'w!ork.('In"the#com!bination,Jyoumust#combineany#sectionsEntitled#\History"inthevdDari-'ousoriginaldoMcumen!ts,xformingonesectionEn!titled\History";likewisecombineany'sectionsEn!titled\Acknowledgements",ۿandanysectionsEntitled\Dedications".]Yeou'm!ustfdeleteallsectionsEntitled\Endorsements."-6.'COLLECTIONSfOFDOCUMENTS('YeouҤma!ymakeacollectionconsistingofңtheDoMcumentandotherdoMcumentsreleased'underthisLicense,sandreplacetheindividualcopiesofthisLicenseinthevdDarious'doMcumen!tsDwithCasinglecopyCthatisincludedinthecollection,ypro!videdthaty!ou'follo!wtthetrulesofthisLicenseforv!erbatimcopyingtofeachtofthedoMcumen!tsinall'otherfrespMects.'Yeou=ma!yextractasingledoMcumentfromsuchacollection,2anddistributeitindividu-'ally4under4thisLicense,Wnpro!videdyou4insertacop!yofthisLicensein!totheextracted'doMcumen!t,andBfollowAthisLicenseinallotherrespMectsregardingv!erbatimcopyingAof'thatfdoMcumen!t.GAppMendixfA:GNUFereeDocumen!tationLicense:1733͍-7.'A!GGREGAeTIONfWITHINDEPENDENTWORKS('A]compilation]oftheDoMcumen!t]oritsderivdDativeswithother]separateandindepMendent
33'doMcumen!tshoriworks,inoroniavolumeiofastorageordistributionmedium,iscalled'an\aggregate"ifthe
cop!yrightresultingfromthecompilationisnotusedtolimitthe'legal1	righ!ts1ofthecompilation'susersbMey!ondwhattheindividualw!orkspMermit.When'theDoMcumen!tisincludedinanaggregate,thisLicensedoesnotapplytotheother'w!orksfintheaggregatewhicharenotthemselvesderivdDativeworksoftheDoMcument.('IfVtheCo!verVTeextrequiremen!tofsection3UisapplicabletothesecopiesoftheDoMcument,'thenDifEtheDoMcumen!tislessthanonehalfoftheen!tireaggregate,~theDoMcumen!t'sCover'Teexts0ma!ybMeplacedoncoversthatbrackettheDoMcumentwithinthe0aggregate,Gorthe'electronic5qequivdDalen!t5pofcovers5piftheDoMcumen!tisinelectronicform.Otherwisethey'm!ustfappMearonprintedcoversthatbracketthewholeaggregate.-8.'TRANSLAeTION('Teranslation̯is̰consideredakindofmoMdication,Asoy!oumay̰distributetranslations'ofTtheTDoMcumen!tunderthetermsofsection4.	ReplacingIn!vdDariantSectionsTwith'translationsvrequiresvspMecialpermissionfromtheirvcop!yrightvholders,butyouvmay'includektranslationsofsomejorallIn!vdDariantkSectionsinadditiontotheoriginalv!ersions'oftheseIn!vdDariantSections.=YeoumayincludeatranslationofthisLicense,
andallthe'licensenoticesintheDoMcumen!t,FandanyWearrantyDisclaimers,Fprovidedthatyou'alsoincludetheoriginalEnglishv!ersionofthisLicenseandtheoriginalv!ersionsof'thosenoticesanddisclaimers.5Incaseofadisagreemen!tbMetweenthetranslationand'the:original:v!ersionofthisLicenseoranoticeordisclaimer,_theoriginalv!ersionwill'prevdDail.'IfpasectioninptheDoMcumen!tisEntitled\Acknowledgements",{\Dedications",orp\His-'tory",Athe(requiremen!t(section4)toPreserveitsTitle(section1)willtypicallyrequire'c!hangingftheactualtitle.-9.'TERMINAeTION('Yeouma!ynotcopye,moMdify,sublicense,ordistributetheDoMcumen!texceptasexpressly'pro!videdunderthisLicense.|Anyattemptotherwisetocop!ye,moMdify,sublicense,or'distributefitisv!oid,andwillautomaticallyterminateyourrightsunderthisLicense.'Ho!wever,ifAyou@ceaseallviolationofthisLicense,theny!ourlicensefromaparticular'cop!yrightJholderisJreinstated(a)pro!visionallye,sunlessanduntilJthecopyrightholder'explicitly_andnallyterminatesy!ourlicense,0and(b)pMermanentlye,0ifthecopyright'holder"failstonotifyy!ouoftheviolation"bysomereasonablemeanspriorto60days'afterfthecessation.('Moreo!ver,8your
licensefromaparticularcop!yright
holderisreinstatedpMermanen!tlyif'theV`cop!yrightholderVanotiesyouoftheviolationVabysomereasonablemeans,fbthisisthe'rstWtimey!ouWhaveWreceivednoticeofviolationWofthisLicense(foranyWwork)fromthat'cop!yrightholder,andy!oucuretheviolationpriorto30daysafteryourreceiptofthe'notice.'TeerminationNuofy!ourrightsunderthissectionNtdoMesnotterminatethelicensesofparties'whoqha!vereceivedcopiesorrightsfromyoupunderthisLicense.Ifyourrightshave'bMeenterminatedandnotpermanen!tlyreinstated,:receiptofacopyofsomeorallofthe'samefmaterialdoMesnotgiv!eyouanyrightstouseit.bGAppMendixfA:GNUFereeDocumen!tationLicense:1833͍10.'FUTUREfREVISIONSOFTHISLICENSE33'TheaFereebSoft!wareFeoundationbmaypublishbnew,Urevisedv!ersionsoftheGNU	Feree
33'DoMcumen!tationLicensefromtimetotime.xRSuchnewversionswillbMesimilarinspirit'to thepresen!tversion,?butmaydierindetailtoaddress newproblemsorconcerns.'Seefhttp://www.gnu.org/copyleft/.'Eac!hversionoftheLicenseisgivenadistinguishingversionnumbMer.IftheDocumen!t'spMeciesrthataparticularn!umberedrversionofthisLicense\oranylaterversion"'appliesQtoPit,Ly!ouhaveQtheoptionPoffollowingthetermsPandconditionseitherofthat'spMeciedv!ersionorofanylaterversionthathasbMeenpublished(notasadraft)by'the!Feree"Soft!wareFeoundation.If"theDoMcument"does!notspecify"av!ersionnumbMer!of'this$License,D)y!oumaychoMose$anyversioneverpublished(notasadraft)bytheFeree'Soft!wareUFeoundation.mIftheDoMcumen!tspeciesthatapro!xyTcandecidewhichfuture'v!ersions)of*thisLicensecanbMeused,thatpro!xy'spublicstatement*ofacceptanceofa'v!ersionfpMermanentlyauthorizesyoutochoMosethatversionfortheDoMcument.11.'RELICENSING'\Massiv!e{"Multiauthor{#CollabMorationSite"(or\MMCzSite")meansany{#WeorldWide'WeebLeserv!erthatpublishescopyrightableLfworksandalsoprovidesprominentfacilities'forMan!ybModytoeditthosew!orks.EAMpublicwikithatManybModycaneditisanexampleof'suc!hYaserver.A?\MassiveXMultiauthorCollabMoration"(or\MMC")>containedinthe'sitefmeansan!ysetofcopyrightableworksthuspublishedontheMMCsite.'\CC-BY-SA"8means8the8Creativ!eCommonsAttribution-Share8Alike3.08licensepub-'lished8b!y8CreativeCommons8CorpMoration,N(anot-for-protcorpMorationwithaprincipal'placeofbusinessinSanFerancisco,7California,7asw!ellasfuturecopyleftversionsofthat'licensefpublishedb!ythatsameorganization.'\IncorpMorate"zmeanstopublishyorrepublishaDocumen!t,?inwholeoryinpart,aspart'offanotherDoMcumen!t.'An&\MMC&<is\eligible&]forrelicensing"ifitislicensedunderthisLicense,?andifallw!orks'that
w!ererstpublishedunderthisLicensesomewhereotherthanthisMMC,and'subsequen!tly-incorpMorated-inwholeorinpartin!totheMMC,(1)hadnoco!ver-texts'orfin!vdDariantsections,and(2)werethusincorpMoratedpriortoNovembMer1,2008.'TheopMeratorofanMMCzSitema!yrepublishanMMCzcon!tainedinthesiteunder'CC-BY-SAonthesamesiteatan!ytimebMeforeAugust1,[2009,pro!videdtheMMCis'eligiblefforrelicensing.GAppMendixfA:GNUFereeDocumen!tationLicense:1933͍G\ADDENDUM:f@HowtousethisLicenseforyourdos3cuments33GTeo'usethisLicenseinadoMcumen!tyou'havewritten,HUincludeacopyoftheLicenseinthe
33GdoMcumen!tfandputthefollowingcopyrightandlicensenoticesjustafterthetitlepage:
8lCopyright(C)	s,E<x	
cmsltt10Eyearyourname.
8lPermissionisgrantedtocopy,distributeand/ormodifythisdocument8lunderthetermsoftheGNUFreeDocumentationLicense,Version1.38loranylaterversionpublishedbytheFreeSoftwareFoundation;8lwithnoInvariantSections,noFront-CoverTexts,andnoBack-Cover8lTexts.	s,Acopyofthelicenseisincludedinthesectionentitled``GNU8lFreeDocumentationLicense''.O33!GIfy!ouhaveInvdDariantSections,Feront-CoverTeextsandBack-CoverTeexts,replacetheG\with...lTeexts."linefwiththis:AwiththeInvariantSectionsbeingElisttheirtitles,with
AtheFront-CoverTextsbeingElist,andwiththeBack-CoverTextsAbeingElist.%33!GIf:y!ouhaveInvdDariantSectionswithoutCoverTeexts,`"orsomeothercombinationoftheGthree,fmergethoset!wofalternativestosuitthesituation.33!GIf y!ourdoMcumentcontainsnontrivialexamplesofprogramcoMde,awerecommendreleasingGthese-examples-inparallelundery!ourchoice-offreesoft!warelicense,such-astheGNUGGeneralfPublicLicense,topMermittheiruseinfreesoft!ware.
cGAppMendixfB:ConceptIndex x2033͍GSApp=endixzB	QConceptzIndexcNڍG\A
Go		cmr9anc9horedTsearch4U5"		cmmi9:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:=7G\EGev9entTdesignatorsqU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:Z1ڍ\HjhistoryTev9entsKU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U::1>ލhistoryTexpansionU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:̬1HistoryTSearc9hingo~U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:97GAppMendixfC:FeunctionandVariableIndex$2133͍GSApp=endixzC	QFaGunctionzandVariableIndex]m~1G\AGadd_historyʍU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:A5
Gadd_history_time#U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ެ5
Gappend_history2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d8r$G\CGclear_history܍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:6Gcurrent_history㶍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:q6r#G\FGfree_history_entry5U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	75r$G\GGget_history_eventFU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:xK8G\HGhistory_arg_extractU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:]8
Ghistory_baseoU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	*8Ghistory_comment_chariU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ʬ9
Ghistory_expand2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d8Ghistory_expansion_char鍑U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:9Ghistory_getʍU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:A6Ghistory_get_history_statehU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	 #5Ghistory_get_time#U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ެ6Ghistory_inhibit_expansion_function9uU:pU:U:U:U:U:U:U:U:k09Ghistory_is_stifled5U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	76Ghistory_length2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d8Ghistory_listoU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	*6Ghistory_max_entriesU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:]9Ghistory_no_expand_chars}VU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:9Ghistory_quotes_inhibit_expansion֛U:pU:U:U:U:U:U:U:U:U:U:	V9Ghistory_search2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d7Ghistory_search_delimiter_charseU:pU:U:U:U:U:U:U:U:U:U:U:U:U:D9Ghistory_search_pos5U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	77m~1history_search_prefix|U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:L77
'history_set_history_statehU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	 #5history_set_pos㶍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:q6history_subst_char5U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	79history_tokenize#U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ެ8history_total_bytesU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:]6history_truncate_file|U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:L78history_word_delimiters}VU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:9history_write_timestamps.ÍU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:`~9U\N
unext_historyoU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	*7\P
tprevious_history#U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ެ6\Rread_historyoU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	*7
'read_history_range5U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:	77remove_history2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d5replace_history_entry|U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:L75U\Sstifle_history2IU:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:d6\U
tunstifle_history#U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:ެ6
'using_history܍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:5\Wwhere_history܍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:6
'write_history܍U:pU:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:7v;ïeN
#cmbx12cgffcmmi12\Nffcmbx12SNGcmbx12JNjcmbx12E<x	
cmsltt10@<x
cmtt10?!",
3
cmsy10>b>
3
cmmi10=<x
3
cmsltt10<-
3
cmcsc10;m#R
3
cmss10:p0J
3
cmsl107<x
3
cmtt106K`y
3
cmr10ߤN		cmtt95"		cmmi9o		cmr9K`y

cmr10J

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>