diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-11-23 19:26:12 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-11-23 19:26:12 -0500 |
commit | b1b0b2d7c8574132c39d819dc54522b4fe7e6df9 (patch) | |
tree | 95f51da88feb690d1af90b057fc5ce62819d25de /doc/history.ps | |
parent | cdd796540cf235ad4b5d4a892570aba697c7fb61 (diff) |
Readline-6.2 import
Diffstat (limited to 'doc/history.ps')
-rw-r--r-- | doc/history.ps | 279 |
1 files changed, 145 insertions, 134 deletions
diff --git a/doc/history.ps b/doc/history.ps index a0949dc..2d2daf7 100644 --- a/doc/history.ps +++ b/doc/history.ps @@ -11,7 +11,7 @@ %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -D 600 -t letter -o history.ps history.dvi %DVIPSParameters: dpi=600 -%DVIPSSource: TeX output 2009.10.12:1034 +%DVIPSSource: TeX output 2011.02.08:1112 %%BeginProcSet: tex.pro 0 0 %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -3208,20 +3208,20 @@ letter %%EndSetup %%Page: 1 1 TeXDict begin 1 0 bop 150 1318 a Fs(GNU)65 b(History)h(Library)p -150 1418 3600 34 v 1920 1515 a Fr(Edition)31 b(6.1,)h(for)e -Fq(History)e(Library)h Fr(V)-8 b(ersion)31 b(6.1.)3217 -1623 y(Octob)s(er)f(2009)150 4935 y Fp(Chet)45 b(Ramey)-11 +150 1418 3600 34 v 1920 1515 a Fr(Edition)31 b(6.2,)h(for)e +Fq(History)e(Library)h Fr(V)-8 b(ersion)31 b(6.2.)3118 +1623 y(Septem)m(b)s(er)f(2010)150 4935 y Fp(Chet)45 b(Ramey)-11 b(,)46 b(Case)g(W)-11 b(estern)46 b(Reserv)l(e)g(Univ)l(ersit)l(y)150 5068 y(Brian)f(F)-11 b(o)l(x,)45 b(F)-11 b(ree)45 b(Soft)l(w)l(are)h(F) -11 b(oundation)p 150 5141 3600 17 v eop end %%Page: 2 2 -TeXDict begin 2 1 bop 150 3024 a Fr(This)23 b(do)s(cumen)m(t)g(describ) -s(es)g(the)h(GNU)g(History)h(library)e(\(v)m(ersion)h(6.1,)j(9)d(Octob) -s(er)f(2009\),)28 b(a)c(program-)150 3133 y(ming)38 b(to)s(ol)h(that)f -(pro)m(vides)g(a)g(consisten)m(t)i(user)d(in)m(terface)i(for)f -(recalling)h(lines)g(of)f(previously)f(t)m(yp)s(ed)150 +TeXDict begin 2 1 bop 150 3024 a Fr(This)31 b(do)s(cumen)m(t)h(describ) +s(es)f(the)h(GNU)g(History)h(library)e(\(v)m(ersion)i(6.2,)g(Septem)m +(b)s(er)e(6)h(2010\),)j(a)d(pro-)150 3133 y(gramming)23 +b(to)s(ol)g(that)g(pro)m(vides)f(a)h(consisten)m(t)h(user)d(in)m +(terface)j(for)e(recalling)i(lines)f(of)f(previously)g(t)m(yp)s(ed)150 3243 y(input.)150 3377 y(Cop)m(yrigh)m(t)602 3374 y(c)577 -3377 y Fo(\015)30 b Fr(1988{2009)35 b(F)-8 b(ree)31 b(Soft)m(w)m(are)h +3377 y Fo(\015)30 b Fr(1988{2011)35 b(F)-8 b(ree)31 b(Soft)m(w)m(are)h (F)-8 b(oundation,)31 b(Inc.)150 3512 y(P)m(ermission)h(is)h(gran)m (ted)g(to)f(mak)m(e)i(and)d(distribute)h(v)m(erbatim)h(copies)g(of)f (this)g(man)m(ual)h(pro)m(vided)f(the)150 3621 y(cop)m(yrigh)m(t)g @@ -3306,10 +3306,10 @@ g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)40 b Fr(8)275 b(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h (:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)41 b Fr(8)275 -2692 y(2.5)92 b(History)31 b(Programming)f(Example)16 -b Fl(:)g(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) -f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)46 -b Fr(9)150 2934 y Fp(App)t(endix)e(A)160 b(GNU)45 b(F)-11 +2692 y(2.5)92 b(History)31 b(Programming)f(Example)13 +b Fl(:)j(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)43 +b Fr(10)150 2934 y Fp(App)t(endix)h(A)160 b(GNU)45 b(F)-11 b(ree)45 b(Do)t(cumen)l(tation)h(License)446 3067 y Fm(:)20 b(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f (:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:) @@ -3323,64 +3323,69 @@ b(Index)34 b Fm(:)19 b(:)h(:)f(:)79 b Fp(21)p eop end TeXDict begin 1 3 bop 150 -116 a Fr(Chapter)30 b(1:)41 b(Using)30 b(History)h(In)m(teractiv)m(ely)2016 b(1)150 299 y Fn(1)80 b(Using)53 b(History)g(In)l(teractiv)l(ely)150 -613 y Fr(This)42 b(c)m(hapter)h(describ)s(es)f(ho)m(w)g(to)h(use)g(the) +551 y Fr(This)42 b(c)m(hapter)h(describ)s(es)f(ho)m(w)g(to)h(use)g(the) f Fk(gnu)h Fr(History)g(Library)e(in)m(teractiv)m(ely)-8 -b(,)50 b(from)42 b(a)h(user's)150 722 y(standp)s(oin)m(t.)76 +b(,)50 b(from)42 b(a)h(user's)150 661 y(standp)s(oin)m(t.)76 b(It)42 b(should)f(b)s(e)h(considered)g(a)g(user's)g(guide.)76 b(F)-8 b(or)43 b(information)f(on)g(using)g(the)g Fk(gnu)150 -832 y Fr(History)36 b(Library)e(in)h(y)m(our)f(o)m(wn)i(programs,)g +770 y Fr(History)36 b(Library)e(in)h(y)m(our)f(o)m(wn)i(programs,)g (see)f(Chapter)g(2)g([Programming)g(with)g(GNU)h(History],)150 -941 y(page)31 b(4.)150 1214 y Fp(1.1)68 b(History)46 -b(Expansion)150 1373 y Fr(The)f(History)h(library)e(pro)m(vides)i(a)f +880 y(page)31 b(4.)150 1121 y Fp(1.1)68 b(History)46 +b(Expansion)150 1281 y Fr(The)f(History)h(library)e(pro)m(vides)i(a)f (history)g(expansion)g(feature)h(that)g(is)f(similar)h(to)g(the)f -(history)150 1483 y(expansion)g(pro)m(vided)f(b)m(y)h +(history)150 1390 y(expansion)g(pro)m(vided)f(b)m(y)h Fq(csh)p Fr(.)83 b(This)44 b(section)i(describ)s(es)e(the)h(syn)m(tax)h -(used)e(to)i(manipulate)f(the)150 1592 y(history)30 b(information.)275 -1753 y(History)h(expansions)f(in)m(tro)s(duce)g(w)m(ords)g(from)g(the)h +(used)e(to)i(manipulate)f(the)150 1500 y(history)30 b(information.)275 +1640 y(History)h(expansions)f(in)m(tro)s(duce)g(w)m(ords)g(from)g(the)h (history)f(list)h(in)m(to)g(the)g(input)f(stream,)h(making)150 -1863 y(it)g(easy)g(to)g(rep)s(eat)g(commands,)f(insert)g(the)h(argumen) +1750 y(it)g(easy)g(to)g(rep)s(eat)g(commands,)f(insert)g(the)h(argumen) m(ts)f(to)h(a)g(previous)f(command)g(in)m(to)i(the)e(curren)m(t)150 -1973 y(input)f(line,)i(or)g(\014x)f(errors)f(in)h(previous)g(commands)g -(quic)m(kly)-8 b(.)275 2134 y(History)37 b(expansion)f(tak)m(es)i +1860 y(input)f(line,)i(or)g(\014x)f(errors)f(in)h(previous)g(commands)g +(quic)m(kly)-8 b(.)275 2000 y(History)37 b(expansion)f(tak)m(es)i (place)g(in)e(t)m(w)m(o)i(parts.)59 b(The)36 b(\014rst)g(is)h(to)g -(determine)g(whic)m(h)f(line)h(from)150 2243 y(the)42 +(determine)g(whic)m(h)f(line)h(from)150 2110 y(the)42 b(history)f(list)h(should)e(b)s(e)h(used)f(during)g(substitution.)74 b(The)40 b(second)i(is)f(to)h(select)h(p)s(ortions)e(of)150 -2353 y(that)31 b(line)g(for)f(inclusion)h(in)m(to)g(the)g(curren)m(t)f +2219 y(that)31 b(line)g(for)f(inclusion)h(in)m(to)g(the)g(curren)m(t)f (one.)42 b(The)30 b(line)h(selected)h(from)e(the)h(history)f(is)h -(called)h(the)150 2462 y Fj(ev)m(en)m(t)p Fr(,)e(and)c(the)i(p)s +(called)h(the)150 2329 y Fj(ev)m(en)m(t)p Fr(,)e(and)c(the)i(p)s (ortions)e(of)i(that)f(line)h(that)g(are)f(acted)i(up)s(on)c(are)j (called)g Fj(w)m(ords)p Fr(.)39 b(V)-8 b(arious)28 b -Fj(mo)s(di\014ers)150 2572 y Fr(are)33 b(a)m(v)-5 b(ailable)36 +Fj(mo)s(di\014ers)150 2438 y Fr(are)33 b(a)m(v)-5 b(ailable)36 b(to)d(manipulate)h(the)f(selected)h(w)m(ords.)48 b(The)32 b(line)i(is)f(brok)m(en)f(in)m(to)i(w)m(ords)f(in)f(the)i(same)150 -2682 y(fashion)23 b(that)g(Bash)g(do)s(es,)h(so)f(that)h(sev)m(eral)g +2548 y(fashion)23 b(that)g(Bash)g(do)s(es,)h(so)f(that)h(sev)m(eral)g (w)m(ords)e(surrounded)e(b)m(y)j(quotes)g(are)g(considered)g(one)g(w)m -(ord.)150 2791 y(History)37 b(expansions)g(are)g(in)m(tro)s(duced)f(b)m +(ord.)150 2658 y(History)37 b(expansions)g(are)g(in)m(tro)s(duced)f(b)m (y)h(the)g(app)s(earance)g(of)g(the)g(history)f(expansion)h(c)m -(haracter,)150 2901 y(whic)m(h)30 b(is)h(`)p Fq(!)p Fr(')f(b)m(y)g -(default.)150 3126 y Fi(1.1.1)63 b(Ev)m(en)m(t)39 b(Designators)150 -3273 y Fr(An)30 b(ev)m(en)m(t)i(designator)f(is)f(a)h(reference)g(to)g -(a)g(command)f(line)h(en)m(try)f(in)g(the)h(history)f(list.)150 -3473 y Fq(!)432 b Fr(Start)34 b(a)f(history)h(substitution,)g(except)g -(when)f(follo)m(w)m(ed)i(b)m(y)e(a)h(space,)h(tab,)f(the)g(end)f(of)630 -3582 y(the)e(line,)g(or)f(`)p Fq(=)p Fr('.)150 3768 y -Fq(!)p Fh(n)384 b Fr(Refer)30 b(to)i(command)e(line)g -Fj(n)p Fr(.)150 3954 y Fq(!-)p Fh(n)336 b Fr(Refer)30 -b(to)i(the)e(command)g Fj(n)g Fr(lines)h(bac)m(k.)150 -4140 y Fq(!!)384 b Fr(Refer)30 b(to)i(the)e(previous)g(command.)40 -b(This)30 b(is)g(a)h(synon)m(ym)f(for)g(`)p Fq(!-1)p -Fr('.)150 4326 y Fq(!)p Fh(string)144 b Fr(Refer)30 b(to)i(the)e(most)h -(recen)m(t)g(command)f(starting)i(with)e Fj(string)8 -b Fr(.)150 4512 y Fq(!?)p Fh(string)j Fq([?])630 4622 -y Fr(Refer)33 b(to)h(the)f(most)g(recen)m(t)h(command)f(con)m(taining)h -Fj(string)8 b Fr(.)48 b(The)33 b(trailing)h(`)p Fq(?)p -Fr(')f(ma)m(y)h(b)s(e)630 4731 y(omitted)d(if)g(the)f -Fj(string)38 b Fr(is)31 b(follo)m(w)m(ed)h(immediately)g(b)m(y)e(a)h -(newline.)150 4917 y Fq(^)p Fh(string1)11 b Fq(^)p Fh(string2)g -Fq(^)630 5027 y Fr(Quic)m(k)31 b(Substitution.)43 b(Rep)s(eat)31 +(haracter,)150 2767 y(whic)m(h)30 b(is)h(`)p Fq(!)p Fr(')f(b)m(y)g +(default.)150 2972 y Fi(1.1.1)63 b(Ev)m(en)m(t)39 b(Designators)150 +3119 y Fr(An)32 b(ev)m(en)m(t)j(designator)e(is)g(a)g(reference)g(to)h +(a)f(command)f(line)h(en)m(try)g(in)g(the)g(history)g(list.)48 +b(Unless)33 b(the)150 3229 y(reference)e(is)f(absolute,)i(ev)m(en)m(ts) +f(are)g(relativ)m(e)i(to)e(the)f(curren)m(t)g(p)s(osition)h(in)f(the)h +(history)f(list.)150 3397 y Fq(!)432 b Fr(Start)34 b(a)f(history)h +(substitution,)g(except)g(when)f(follo)m(w)m(ed)i(b)m(y)e(a)h(space,)h +(tab,)f(the)g(end)f(of)630 3507 y(the)e(line,)g(or)f(`)p +Fq(=)p Fr('.)150 3672 y Fq(!)p Fh(n)384 b Fr(Refer)30 +b(to)i(command)e(line)g Fj(n)p Fr(.)150 3838 y Fq(!-)p +Fh(n)336 b Fr(Refer)30 b(to)i(the)e(command)g Fj(n)g +Fr(lines)h(bac)m(k.)150 4003 y Fq(!!)384 b Fr(Refer)30 +b(to)i(the)e(previous)g(command.)40 b(This)30 b(is)g(a)h(synon)m(ym)f +(for)g(`)p Fq(!-1)p Fr('.)150 4169 y Fq(!)p Fh(string)144 +b Fr(Refer)25 b(to)h(the)f(most)h(recen)m(t)g(command)f(preceding)g +(the)g(curren)m(t)g(p)s(osition)g(in)g(the)g(history)630 +4278 y(list)31 b(starting)g(with)f Fj(string)8 b Fr(.)150 +4444 y Fq(!?)p Fh(string)j Fq([?])630 4553 y Fr(Refer)25 +b(to)h(the)f(most)h(recen)m(t)g(command)f(preceding)g(the)g(curren)m(t) +g(p)s(osition)g(in)g(the)g(history)630 4663 y(list)32 +b(con)m(taining)h Fj(string)8 b Fr(.)43 b(The)31 b(trailing)h(`)p +Fq(?)p Fr(')f(ma)m(y)h(b)s(e)f(omitted)h(if)f(the)h Fj(string)39 +b Fr(is)31 b(follo)m(w)m(ed)630 4772 y(immediately)h(b)m(y)e(a)h +(newline.)150 4938 y Fq(^)p Fh(string1)11 b Fq(^)p Fh(string2)g +Fq(^)630 5047 y Fr(Quic)m(k)31 b(Substitution.)43 b(Rep)s(eat)31 b(the)g(last)h(command,)g(replacing)f Fj(string1)39 b -Fr(with)31 b Fj(string2)7 b Fr(.)630 5136 y(Equiv)-5 +Fr(with)31 b Fj(string2)7 b Fr(.)630 5157 y(Equiv)-5 b(alen)m(t)31 b(to)g Fq(!!:s/)p Fh(string1)11 b Fq(/)p Fh(string2)g Fq(/)p Fr(.)150 5322 y Fq(!#)384 b Fr(The)30 b(en)m(tire)h(command)f(line)h(t)m(yp)s(ed)f(so)h(far.)p @@ -3846,118 +3851,124 @@ b(Programming)30 b(with)g(GNU)h(History)1780 b(9)3371 299 y([V)-8 b(ariable])-3598 b Fg(int)53 b(history_max_entries)390 408 y Fr(The)45 b(maxim)m(um)h(n)m(um)m(b)s(er)f(of)h(history)g(en)m (tries.)88 b(This)45 b(m)m(ust)h(b)s(e)f(c)m(hanged)i(using)e -Fq(stifle_)390 518 y(history\(\))p Fr(.)3371 701 y([V)-8 +Fq(stifle_)390 518 y(history\(\))p Fr(.)3371 742 y([V)-8 b(ariable])-3598 b Fg(int)53 b(history_write_timesta)q(mps)390 -811 y Fr(If)44 b(non-zero,)49 b(timestamps)c(are)g(written)g(to)g(the)g +852 y Fr(If)44 b(non-zero,)49 b(timestamps)c(are)g(written)g(to)g(the)g (history)f(\014le,)49 b(so)c(they)f(can)h(b)s(e)f(preserv)m(ed)390 -920 y(b)s(et)m(w)m(een)31 b(sessions.)41 b(The)30 b(default)g(v)-5 +962 y(b)s(et)m(w)m(een)31 b(sessions.)41 b(The)30 b(default)g(v)-5 b(alue)31 b(is)f(0,)h(meaning)g(that)g(timestamps)g(are)g(not)f(sa)m(v) -m(ed.)3371 1103 y([V)-8 b(ariable])-3598 b Fg(char)54 -b(history_expansion_char)390 1213 y Fr(The)35 b(c)m(haracter)i(that)e -(in)m(tro)s(duces)g(a)h(history)f(ev)m(en)m(t.)57 b(The)34 -b(default)i(is)f(`)p Fq(!)p Fr('.)56 b(Setting)35 b(this)h(to)g(0)390 -1322 y(inhibits)30 b(history)g(expansion.)3371 1505 y([V)-8 +m(ed.)390 1116 y(The)41 b(curren)m(t)g(timestamp)h(format)g(uses)f(the) +h(v)-5 b(alue)42 b(of)f Fj(history)p 2697 1116 28 4 v +41 w(commen)m(t)p 3098 1116 V 41 w(c)m(har)48 b Fr(to)42 +b(delimit)390 1226 y(timestamp)h(en)m(tries)g(in)f(the)g(history)h +(\014le.)76 b(If)42 b(that)h(v)-5 b(ariable)43 b(do)s(es)f(not)g(ha)m +(v)m(e)i(a)f(v)-5 b(alue)42 b(\(the)390 1335 y(default\),)31 +b(timestamps)g(will)g(not)f(b)s(e)g(written.)3371 1560 +y([V)-8 b(ariable])-3598 b Fg(char)54 b(history_expansion_char)390 +1669 y Fr(The)35 b(c)m(haracter)i(that)e(in)m(tro)s(duces)g(a)h +(history)f(ev)m(en)m(t.)57 b(The)34 b(default)i(is)f(`)p +Fq(!)p Fr('.)56 b(Setting)35 b(this)h(to)g(0)390 1779 +y(inhibits)30 b(history)g(expansion.)3371 2003 y([V)-8 b(ariable])-3598 b Fg(char)54 b(history_subst_char)390 -1615 y Fr(The)40 b(c)m(haracter)i(that)g(in)m(v)m(ok)m(es)g(w)m(ord)f +2113 y Fr(The)40 b(c)m(haracter)i(that)g(in)m(v)m(ok)m(es)g(w)m(ord)f (substitution)f(if)h(found)e(at)i(the)g(start)g(of)g(a)g(line.)72 -b(The)390 1725 y(default)31 b(is)f(`)p Fq(^)p Fr('.)3371 -1908 y([V)-8 b(ariable])-3598 b Fg(char)54 b(history_comment_char)390 -2017 y Fr(During)37 b(tok)m(enization,)43 b(if)38 b(this)f(c)m +b(The)390 2222 y(default)31 b(is)f(`)p Fq(^)p Fr('.)3371 +2447 y([V)-8 b(ariable])-3598 b Fg(char)54 b(history_comment_char)390 +2556 y Fr(During)37 b(tok)m(enization,)43 b(if)38 b(this)f(c)m (haracter)j(is)e(seen)f(as)h(the)g(\014rst)f(c)m(haracter)j(of)e(a)g(w) -m(ord,)h(then)390 2127 y(it)44 b(and)e(all)j(subsequen)m(t)d(c)m +m(ord,)h(then)390 2666 y(it)44 b(and)e(all)j(subsequen)m(t)d(c)m (haracters)j(up)d(to)i(a)g(newline)f(are)h(ignored,)i(suppressing)c -(history)390 2236 y(expansion)30 b(for)g(the)h(remainder)f(of)g(the)h +(history)390 2776 y(expansion)30 b(for)g(the)h(remainder)f(of)g(the)h (line.)41 b(This)29 b(is)i(disabled)f(b)m(y)g(default.)3371 -2419 y([V)-8 b(ariable])-3598 b Fg(char)54 b(*)e -(history_word_delimiter)q(s)390 2529 y Fr(The)27 b(c)m(haracters)i +3000 y([V)-8 b(ariable])-3598 b Fg(char)54 b(*)e +(history_word_delimiter)q(s)390 3110 y Fr(The)27 b(c)m(haracters)i (that)f(separate)h(tok)m(ens)f(for)f Fq(history_tokenize\(\))p Fr(.)35 b(The)27 b(default)h(v)-5 b(alue)28 b(is)f Fq(")390 -2638 y(\\t\\n\(\)<>;&|")p Fr(.)3371 2821 y([V)-8 b(ariable])-3598 +3219 y(\\t\\n\(\)<>;&|")p Fr(.)3371 3444 y([V)-8 b(ariable])-3598 b Fg(char)54 b(*)e(history_search_delimit)q(er_)q(cha)q(rs)390 -2931 y Fr(The)26 b(list)g(of)g(additional)h(c)m(haracters)h(whic)m(h)e +3553 y Fr(The)26 b(list)g(of)g(additional)h(c)m(haracters)h(whic)m(h)e (can)g(delimit)h(a)f(history)g(searc)m(h)h(string,)g(in)f(addition)390 -3041 y(to)31 b(space,)g(T)-8 b(AB,)32 b(`)p Fq(:)p Fr(')e(and)g(`)p +3663 y(to)31 b(space,)g(T)-8 b(AB,)32 b(`)p Fq(:)p Fr(')e(and)g(`)p Fq(?)p Fr(')g(in)g(the)h(case)g(of)g(a)g(substring)e(searc)m(h.)41 -b(The)30 b(default)h(is)f(empt)m(y)-8 b(.)3371 3224 y([V)g(ariable]) +b(The)30 b(default)h(is)f(empt)m(y)-8 b(.)3371 3887 y([V)g(ariable]) -3598 b Fg(char)54 b(*)e(history_no_expand_char)q(s)390 -3333 y Fr(The)29 b(list)i(of)f(c)m(haracters)h(whic)m(h)e(inhibit)h +3997 y Fr(The)29 b(list)i(of)f(c)m(haracters)h(whic)m(h)e(inhibit)h (history)g(expansion)f(if)h(found)e(immediately)j(follo)m(wing)390 -3443 y Fj(history)p 672 3443 28 4 v 40 w(expansion)p -1104 3443 V 40 w(c)m(har)7 b Fr(.)41 b(The)29 b(default)i(is)f(space,)i +4106 y Fj(history)p 672 4106 V 40 w(expansion)p 1104 +4106 V 40 w(c)m(har)7 b Fr(.)41 b(The)29 b(default)i(is)f(space,)i (tab,)e(newline,)h(carriage)h(return,)d(and)h(`)p Fq(=)p -Fr('.)3371 3626 y([V)-8 b(ariable])-3598 b Fg(int)53 -b(history_quotes_inhibi)q(t_ex)q(pan)q(sio)q(n)390 3735 +Fr('.)3371 4331 y([V)-8 b(ariable])-3598 b Fg(int)53 +b(history_quotes_inhibi)q(t_ex)q(pan)q(sio)q(n)390 4440 y Fr(If)29 b(non-zero,)h(single-quoted)g(w)m(ords)f(are)g(not)h (scanned)f(for)g(the)g(history)g(expansion)g(c)m(haracter.)390 -3845 y(The)h(default)g(v)-5 b(alue)31 b(is)g(0.)3371 -4028 y([V)-8 b(ariable])-3598 b Fg(rl_linebuf_func_t)57 +4550 y(The)h(default)g(v)-5 b(alue)31 b(is)g(0.)3371 +4774 y([V)-8 b(ariable])-3598 b Fg(rl_linebuf_func_t)57 b(*)c(history_inhibit_expans)q(ion)q(_fu)q(ncti)q(on)390 -4137 y Fr(This)32 b(should)h(b)s(e)f(set)i(to)g(the)g(address)e(of)i(a) +4884 y Fr(This)32 b(should)h(b)s(e)f(set)i(to)g(the)g(address)e(of)i(a) f(function)g(that)h(tak)m(es)h(t)m(w)m(o)g(argumen)m(ts:)46 -b(a)34 b Fq(char)29 b(*)390 4247 y Fr(\()p Fj(string)8 +b(a)34 b Fq(char)29 b(*)390 4994 y Fr(\()p Fj(string)8 b Fr(\))27 b(and)f(an)g Fq(int)g Fr(index)g(in)m(to)i(that)f(string)f (\()p Fj(i)5 b Fr(\).)40 b(It)27 b(should)f(return)f(a)i(non-zero)g(v) --5 b(alue)27 b(if)g(the)390 4357 y(history)i(expansion)g(starting)h(at) +-5 b(alue)27 b(if)g(the)390 5103 y(history)i(expansion)g(starting)h(at) g Fj(string[i])j Fr(should)28 b(not)i(b)s(e)e(p)s(erformed;)h(zero)h -(if)f(the)g(expansion)390 4466 y(should)i(b)s(e)g(done.)45 +(if)f(the)g(expansion)390 5213 y(should)i(b)s(e)g(done.)45 b(It)32 b(is)g(in)m(tended)g(for)g(use)g(b)m(y)f(applications)i(lik)m -(e)h(Bash)e(that)g(use)g(the)g(history)390 4576 y(expansion)e(c)m +(e)h(Bash)e(that)g(use)g(the)g(history)390 5322 y(expansion)e(c)m (haracter)i(for)e(additional)i(purp)s(oses.)39 b(By)30 b(default,)h(this)f(v)-5 b(ariable)31 b(is)g(set)g(to)g -Fq(NULL)p Fr(.)150 4807 y Fp(2.5)68 b(History)46 b(Programming)g -(Example)150 4967 y Fr(The)30 b(follo)m(wing)i(program)e(demonstrates)h -(simple)f(use)g(of)h(the)f Fk(gnu)g Fr(History)h(Library)-8 -b(.)390 5078 y Fe(#include)41 b(<stdio.h>)390 5166 y(#include)g -(<readline/history.h>)390 5340 y(main)f(\(argc,)h(argv\))p -eop end +Fq(NULL)p Fr(.)p eop end %%Page: 10 13 TeXDict begin 10 12 bop 150 -116 a Fr(Chapter)30 b(2:)41 -b(Programming)30 b(with)g(GNU)h(History)1734 b(10)586 -299 y Fe(int)40 b(argc;)586 386 y(char)g(**argv;)390 -473 y({)468 560 y(char)h(line[1024],)g(*t;)468 648 y(int)f(len,)g(done) -h(=)e(0;)468 822 y(line[0])i(=)f(0;)468 996 y(using_history)j(\(\);)468 -1083 y(while)e(\(!done\))547 1171 y({)625 1258 y(printf)g(\("history$)g -("\);)625 1345 y(fflush)g(\(stdout\);)625 1432 y(t)f(=)f(fgets)i -(\(line,)f(sizeof)h(\(line\))f(-)g(1,)g(stdin\);)625 -1519 y(if)g(\(t)g(&&)f(*t\))704 1606 y({)782 1694 y(len)h(=)g(strlen)g -(\(t\);)782 1781 y(if)g(\(t[len)h(-)e(1])h(==)f('\\n'\))861 -1868 y(t[len)h(-)g(1])f(=)h('\\0';)704 1955 y(})625 2130 -y(if)g(\(!t\))704 2217 y(strcpy)g(\(line,)h("quit"\);)625 -2391 y(if)f(\(line[0]\))704 2478 y({)782 2565 y(char)g(*expansion;)782 -2653 y(int)g(result;)782 2827 y(result)h(=)e(history_expand)k(\(line,)d -(&expansion\);)782 2914 y(if)g(\(result\))861 3001 y(fprintf)h -(\(stderr,)g("\045s\\n",)f(expansion\);)782 3176 y(if)g(\(result)h(<)e -(0)h(||)f(result)i(==)f(2\))861 3263 y({)939 3350 y(free)g -(\(expansion\);)939 3437 y(continue;)861 3524 y(})782 -3699 y(add_history)i(\(expansion\);)782 3786 y(strncpy)f(\(line,)g -(expansion,)g(sizeof)g(\(line\))f(-)g(1\);)782 3873 y(free)g -(\(expansion\);)704 3960 y(})625 4134 y(if)g(\(strcmp)h(\(line,)f -("quit"\))h(==)f(0\))704 4222 y(done)g(=)f(1;)625 4309 +b(Programming)30 b(with)g(GNU)h(History)1734 b(10)150 +299 y Fp(2.5)68 b(History)46 b(Programming)g(Example)150 +458 y Fr(The)30 b(follo)m(wing)i(program)e(demonstrates)h(simple)f(use) +g(of)h(the)f Fk(gnu)g Fr(History)h(Library)-8 b(.)390 +633 y Fe(#include)41 b(<stdio.h>)390 720 y(#include)g +(<readline/history.h>)390 894 y(main)f(\(argc,)h(argv\))586 +981 y(int)f(argc;)586 1068 y(char)g(**argv;)390 1156 +y({)468 1243 y(char)h(line[1024],)g(*t;)468 1330 y(int)f(len,)g(done)h +(=)e(0;)468 1504 y(line[0])i(=)f(0;)468 1679 y(using_history)j(\(\);) +468 1766 y(while)e(\(!done\))547 1853 y({)625 1940 y(printf)g +(\("history$)g("\);)625 2027 y(fflush)g(\(stdout\);)625 +2115 y(t)f(=)f(fgets)i(\(line,)f(sizeof)h(\(line\))f(-)g(1,)g(stdin\);) +625 2202 y(if)g(\(t)g(&&)f(*t\))704 2289 y({)782 2376 +y(len)h(=)g(strlen)g(\(t\);)782 2463 y(if)g(\(t[len)h(-)e(1])h(==)f +('\\n'\))861 2550 y(t[len)h(-)g(1])f(=)h('\\0';)704 2638 +y(})625 2812 y(if)g(\(!t\))704 2899 y(strcpy)g(\(line,)h("quit"\);)625 +3073 y(if)f(\(line[0]\))704 3161 y({)782 3248 y(char)g(*expansion;)782 +3335 y(int)g(result;)782 3509 y(result)h(=)e(history_expand)k(\(line,)d +(&expansion\);)782 3597 y(if)g(\(result\))861 3684 y(fprintf)h +(\(stderr,)g("\045s\\n",)f(expansion\);)782 3858 y(if)g(\(result)h(<)e +(0)h(||)f(result)i(==)f(2\))861 3945 y({)939 4032 y(free)g +(\(expansion\);)939 4120 y(continue;)861 4207 y(})782 +4381 y(add_history)i(\(expansion\);)782 4468 y(strncpy)f(\(line,)g +(expansion,)g(sizeof)g(\(line\))f(-)g(1\);)782 4555 y(free)g +(\(expansion\);)704 4643 y(})625 4817 y(if)g(\(strcmp)h(\(line,)f +("quit"\))h(==)f(0\))704 4904 y(done)g(=)f(1;)625 4991 y(else)h(if)g(\(strcmp)h(\(line,)g("save"\))f(==)g(0\))704 -4396 y(write_history)i(\("history_file"\);)625 4483 y(else)e(if)g -(\(strcmp)h(\(line,)g("read"\))f(==)g(0\))704 4570 y(read_history)i -(\("history_file"\);)625 4658 y(else)e(if)g(\(strcmp)h(\(line,)g -("list"\))f(==)g(0\))704 4745 y({)782 4832 y(register)h(HIST_ENTRY)h -(**the_list;)782 4919 y(register)f(int)f(i;)782 5093 -y(the_list)h(=)f(history_list)i(\(\);)782 5181 y(if)e(\(the_list\))861 -5268 y(for)g(\(i)f(=)h(0;)f(the_list[i];)j(i++\))p eop -end +5078 y(write_history)i(\("history_file"\);)625 5166 y(else)e(if)g +(\(strcmp)h(\(line,)g("read"\))f(==)g(0\))704 5253 y(read_history)i +(\("history_file"\);)625 5340 y(else)e(if)g(\(strcmp)h(\(line,)g +("list"\))f(==)g(0\))p eop end %%Page: 11 14 TeXDict begin 11 13 bop 150 -116 a Fr(Chapter)30 b(2:)41 -b(Programming)30 b(with)g(GNU)h(History)1734 b(11)939 -299 y Fe(printf)41 b(\("\045d:)f(\045s\\n",)h(i)e(+)h(history_base,)i -(the_list[i]->line\);)704 386 y(})625 473 y(else)e(if)g(\(strncmp)h -(\(line,)g("delete",)g(6\))f(==)f(0\))704 560 y({)782 -648 y(int)h(which;)782 735 y(if)g(\(\(sscanf)h(\(line)f(+)g(6,)g -("\045d",)g(&which\)\))h(==)f(1\))861 822 y({)939 909 -y(HIST_ENTRY)i(*entry)e(=)g(remove_history)i(\(which\);)939 -996 y(if)e(\(!entry\))1018 1083 y(fprintf)g(\(stderr,)i("No)d(such)i -(entry)f(\045d\\n",)h(which\);)939 1171 y(else)1018 1258 -y({)1096 1345 y(free)f(\(entry->line\);)1096 1432 y(free)g(\(entry\);) -1018 1519 y(})861 1606 y(})782 1694 y(else)861 1781 y({)939 -1868 y(fprintf)h(\(stderr,)g("non-numeric)h(arg)e(given)g(to)g -(`delete'\\n"\);)861 1955 y(})704 2042 y(})547 2130 y(})390 -2217 y(})p eop end +b(Programming)30 b(with)g(GNU)h(History)1734 b(11)704 +299 y Fe({)782 386 y(register)41 b(HIST_ENTRY)h(**the_list;)782 +473 y(register)f(int)f(i;)782 648 y(the_list)h(=)f(history_list)i +(\(\);)782 735 y(if)e(\(the_list\))861 822 y(for)g(\(i)f(=)h(0;)f +(the_list[i];)j(i++\))939 909 y(printf)f(\("\045d:)f(\045s\\n",)h(i)e +(+)h(history_base,)i(the_list[i]->line\);)704 996 y(})625 +1083 y(else)e(if)g(\(strncmp)h(\(line,)g("delete",)g(6\))f(==)f(0\))704 +1171 y({)782 1258 y(int)h(which;)782 1345 y(if)g(\(\(sscanf)h(\(line)f +(+)g(6,)g("\045d",)g(&which\)\))h(==)f(1\))861 1432 y({)939 +1519 y(HIST_ENTRY)i(*entry)e(=)g(remove_history)i(\(which\);)939 +1606 y(if)e(\(!entry\))1018 1694 y(fprintf)g(\(stderr,)i("No)d(such)i +(entry)f(\045d\\n",)h(which\);)939 1781 y(else)1018 1868 +y({)1096 1955 y(free)f(\(entry->line\);)1096 2042 y(free)g(\(entry\);) +1018 2130 y(})861 2217 y(})782 2304 y(else)861 2391 y({)939 +2478 y(fprintf)h(\(stderr,)g("non-numeric)h(arg)e(given)g(to)g +(`delete'\\n"\);)861 2565 y(})704 2653 y(})547 2740 y(})390 +2827 y(})p eop end %%Page: 12 15 TeXDict begin 12 14 bop 150 -116 a Fr(App)s(endix)29 b(A:)h(GNU)h(F)-8 b(ree)32 b(Do)s(cumen)m(tation)g(License)1603 |