Check for wint_t and attempt to allow compiles even when wint_t isn't
authorNalin Dahyabhai <nalin@src.gnome.org>
Tue, 30 Jul 2002 23:00:34 +0000 (23:00 +0000)
committerNalin Dahyabhai <nalin@src.gnome.org>
Tue, 30 Jul 2002 23:00:34 +0000 (23:00 +0000)
* configure.in: Check for wint_t and attempt to allow compiles even when wint_t
isn't defined (this type is used only debug code, so it shouldn't break
anything).
* src/caps.c: Remove "te" and "ti", which are logical, in the same way "so" is,
from the known capabilities lists.  Add a "is a key" field to the
termcap list so that we don't match against keystrokes in case they're
also control sequences.
* src/interpret.c: Use tables instead of tries.  Don't add key sequences to the
table.
* src/pty.c: Fix incorrect invocation in sample.
* src/reaper.c: Include stdlib.h to quiet compiler warning.
* src/trie.c, src/trie.h: Remove the unused precomputing routines.
* src/utf8echo.c: Switch to link with tables instead of tries.
* src/vte.c: Switch to using tables instead of tries.  Don't add key sequences
to the table.  Map cursor-backward to LE instead of le, which handles
parameters right.  Tune updates so that they occur less often when we're
processing large amounts of data from the child.  Add a
'status-line-changed' signal.  Implement fs() and fix ts().  Add
::get_status_line() to get the contents of the status line.  Obey it()
when setting default tabstops.  Implement cursor_next_line(),
cursor_lower_left(), cursor_preceding_line(),
cursor_horizontal_and_vertical_position(), erase_characters(), and
insert_blank_characters().  Implement nw().

20 files changed:
ChangeLog
README
configure.in
po/da.po
po/sv.po
src/Makefile.am
src/caps.c
src/caps.h
src/interpret.c
src/pty.c
src/reaper.c
src/table.c
src/termcap.c
src/trie.c
src/trie.h
src/utf8echo.c
src/vte.c
src/vte.h
src/vteapp.c
vte.spec

index 9ccb863..9f613ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2002-07-30  nalin
+       * configure.in: Check for wint_t and attempt to allow compiles even
+       when wint_t isn't defined (this type is used only debug code, so it
+       shouldn't break anything).
+       * src/caps.c: Remove "te" and "ti", which are logical, in the same way
+       "so" is, from the known capabilities lists.  Add a "is a key" field to
+       the termcap list so that we don't match against keystrokes in case
+       they're also control sequences.
+       * src/interpret.c: Use tables instead of tries.  Don't add key sequences
+       to the table.
+       * src/pty.c: Fix incorrect invocation in sample.
+       * src/reaper.c: Include stdlib.h to quiet compiler warning.
+       * src/trie.c, src/trie.h: Remove the unused precomputing routines.
+       * src/utf8echo.c: Switch to link with tables instead of tries.
+       * src/vte.c: Switch to using tables instead of tries.  Map
+       cursor-backward to LE instead of le, which handles parameters right.
+       Don't add key sequences to the parsing table.  Tune updates so that
+       they occur less often when we're processing large amounts of data from
+       the child.  Add a 'status-line-changed' signal.  Implement fs() and
+       fix ts().  Add ::get_status_line() to get the contents of the status
+       line.  Obey it() when setting default tabstops.  Implement
+       cursor_next_line(), cursor_lower_left(), cursor_preceding_line(),
+       cursor_horizontal_and_vertical_position(), erase_characters(), and
+       insert_blank_characters().  Implement nw().
+
 2002-07-26  nalin
        * src/vte.c: Initialize new lines added for al().  Spotted by jrb.
 
diff --git a/README b/README
index 1ff1e6d..86c98fa 100644 (file)
--- a/README
+++ b/README
   should probably be using profterm.
 
 * How does it work?
-- The VTE library inserts terminal capability strings into a trie, and then
-  uses it to determine if data received from a pseudo-terminal is a control
-  sequence or just random data.  The sample program "interpret" illustrates
-  more or less what the widget sees after it filters incoming data.
+- The VTE library inserts terminal capability strings into a tree of tables,
+  and then uses it to determine if data received from a pseudo-terminal is a
+  control sequence or just random data.  The sample program "interpret"
+  illustrates more or less what the widget sees after it filters incoming data.
 
 * What's missing?
 - Accessibility isn't completed yet.
@@ -26,7 +26,7 @@
   probably shouldn't.
 - Most control sequences are recognized, but many aren't implemented.  There
   are enough to run ls, vim, less, emacs and mutt, but more need to be
-  implemented (ff, fs, i1, i3, is, iP, LF, LO, MC, mh, ML, mm, mo, nw, pf,
+  implemented (ff, i1, i3, is, iP, LF, LO, MC, mh, ML, mm, mo, nw, pf,
   pk, pl, pf, po, pO, ps, px, r1, r2, r3, RA, RF, rp, rs, RX, SA, SX, wi,
   several more from the XTerm set).
 - I'm not sure the widget implementation itself is correct.  There are many
index ae59bf4..0063104 100644 (file)
@@ -67,6 +67,7 @@ fi
 if test x$VTE_DEBUG = x1 ; then
        AC_DEFINE(VTE_DEBUG,,[Enable debugging messages.])
 fi
+AC_CHECK_TYPE(wint_t,AC_DEFINE(HAVE_WINT_T,1,[Define if your OS provides a wint_t type and a corresponding %lc format specifier.]))
 
 AC_MSG_CHECKING([for pygtk-2.0])
 if pkg-config --exists pygtk-2.0 ; then
index e4f6c64..1d02a2d 100644 (file)
--- a/po/da.po
+++ b/po/da.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vte\n"
-"POT-Creation-Date: 2002-07-25 17:52-0400\n"
+"POT-Creation-Date: 2002-07-30 18:18-0400\n"
 "PO-Revision-Date: 2002-07-25 23:33+0200\n"
 "Last-Translator: Ole Laursen <olau@hardworking.dk>\n"
 "Language-Team: Danish <dansk@klid.dk>\n"
@@ -19,104 +19,104 @@ msgstr ""
 msgid "Error adding `%s' to environment, continuing."
 msgstr "Fejl ved tilføjelse af '%s' til miljøet, fortsætter."
 
-#: src/pty.c:138 src/vte.c:8612
+#: src/pty.c:138 src/vte.c:8660
 #, c-format
 msgid "Error setting PTY size: %s."
 msgstr "Fejl ved angivelse af PTY-størrelse: %s."
 
-#: src/reaper.c:113
+#: src/reaper.c:114
 msgid "Error creating signal pipe."
 msgstr "Fejl ved oprettelse af signaldatakanal."
 
-#: src/trie.c:410
+#: src/trie.c:400
 #, c-format
 msgid "Duplicate (%s/%s)!"
 msgstr "Optræder mere end én gang (%s/%s)!"
 
-#: src/vte.c:972
+#: src/vte.c:1008
 #, c-format
 msgid "Error compiling regular expression \"%s\"."
 msgstr "Fejl ved oversættelse af regulært udtryk \"%s\"."
 
-#: src/vte.c:1343 src/vte.c:1352 src/vte.c:1362 src/vte.c:1376 src/vte.c:1381
-#: src/vte.c:1386
+#: src/vte.c:1379 src/vte.c:1388 src/vte.c:1398 src/vte.c:1412 src/vte.c:1417
+#: src/vte.c:1422
 #, c-format
 msgid "Unable to convert characters from %s to %s."
 msgstr "Kunne ikke konvertere tegn fra %s til %s."
 
-#: src/vte.c:4409
+#: src/vte.c:4546
 #, c-format
 msgid "Got unexpected (key?) sequence `%s'."
 msgstr "Modtog uventet (taste-?) sekvens '%s'."
 
-#: src/vte.c:5133
+#: src/vte.c:5277
 #, c-format
 msgid "Character 0x%x is undefined, allocating one column."
 msgstr "Tegn 0x%x er ikke defineret, allokerer en kolonne."
 
-#: src/vte.c:5324
+#: src/vte.c:5468
 #, c-format
 msgid "No handler for control sequence `%s' defined."
 msgstr "Ingen håndtering for kontrolsekvensen '%s' er defineret."
 
-#: src/vte.c:5955
+#: src/vte.c:6003
 #, c-format
 msgid "Error reading from child: %s."
 msgstr "Fejl ved læsning fra underproces: %s."
 
-#: src/vte.c:6123
+#: src/vte.c:6171
 #, c-format
 msgid "Error (%s) converting data for child, dropping."
 msgstr "Fejl (%s) ved konvertering af data for underproces, dropper."
 
-#: src/vte.c:7867
+#: src/vte.c:7915
 #, c-format
 msgid ""
 "Warning: using fontset \"%s\", which is missing these character sets: %s."
 msgstr "Advarsel: bruger skrifttypesættet \"%s\" som mangle disse tegnsæt: %s."
 
-#: src/vte.c:8411
+#: src/vte.c:8459
 #, c-format
 msgid "Failed to load Xft font pattern \"%s\", falling back to default font."
 msgstr ""
 "Kunne ikke indlæse Xft-skrifttypemønstret \"%s\", falder tilbage til "
 "standardskrifttypen."
 
-#: src/vte.c:8424
+#: src/vte.c:8472
 msgid "Failed to load default Xft font."
 msgstr "Kunne ikke indlæse standard-Xft-skrifttypen."
 
-#: src/vte.c:8467
+#: src/vte.c:8515
 msgid "Error allocating Xft font, disabling Xft."
 msgstr "Fejl ved allokering af Xft-skrifttype, deaktiverer Xft."
 
-#: src/vte.c:8491
+#: src/vte.c:8539
 #, c-format
 msgid "Failed to load font set \"%s\", falling back to default font."
 msgstr ""
 "Kunne ikke indlæse skrifttypesættet \"%s\", falder tilbage til "
 "standardskrifttypen."
 
-#: src/vte.c:8503
+#: src/vte.c:8551
 msgid "Failed to load default font, crashing or behaving abnormally."
 msgstr ""
 "Kunne ikke indlæse standardskrifttypen; vil nu gå ned eller udvise anormal "
 "adfærd."
 
-#: src/vte.c:8586
+#: src/vte.c:8634
 #, c-format
 msgid "Error reading PTY size, using defaults: %s."
 msgstr "Fejl ved indlæsning af PTY-størrelse, bruger standardværdier: %s."
 
-#: src/vte.c:10728
+#: src/vte.c:10776
 msgid "Error allocating layout, disabling Pango."
 msgstr "Fejl ved allokering af layout, deaktiverer Pango."
 
-#: src/vte.c:10738
+#: src/vte.c:10786
 msgid "Error allocating draw, disabling Xft."
 msgstr "Fejl ved allokering af tegning, deaktiverer Xft."
 
 #. Aaargh.  We're screwed.
-#: src/vte.c:11957
+#: src/vte.c:12014
 msgid "g_iconv_open() failed setting word characters"
 msgstr "g_iconv_open() kunne ikke angive ordtegn"
index 92dcc16..86cf28a 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vte\n"
-"POT-Creation-Date: 2002-07-25 17:52-0400\n"
+"POT-Creation-Date: 2002-07-30 18:18-0400\n"
 "PO-Revision-Date: 2002-07-18 19:08+0200\n"
 "Last-Translator: Christian Rose <menthos@menthos.com>\n"
 "Language-Team: Swedish <sv@li.org>\n"
@@ -20,57 +20,57 @@ msgstr ""
 msgid "Error adding `%s' to environment, continuing."
 msgstr "Fel vid tillägg av \"%s\" till miljön, fortsätter."
 
-#: src/pty.c:138 src/vte.c:8612
+#: src/pty.c:138 src/vte.c:8660
 #, c-format
 msgid "Error setting PTY size: %s."
 msgstr "Fel vid läsande av PTY-storlek: %s."
 
-#: src/reaper.c:113
+#: src/reaper.c:114
 msgid "Error creating signal pipe."
 msgstr "Fel vid skapande av signalrör."
 
-#: src/trie.c:410
+#: src/trie.c:400
 #, c-format
 msgid "Duplicate (%s/%s)!"
 msgstr "Dubbel (%s/%s)!"
 
-#: src/vte.c:972
+#: src/vte.c:1008
 #, c-format
 msgid "Error compiling regular expression \"%s\"."
 msgstr "Fel vid kompilering av reguljärt uttryck \"%s\"."
 
-#: src/vte.c:1343 src/vte.c:1352 src/vte.c:1362 src/vte.c:1376 src/vte.c:1381
-#: src/vte.c:1386
+#: src/vte.c:1379 src/vte.c:1388 src/vte.c:1398 src/vte.c:1412 src/vte.c:1417
+#: src/vte.c:1422
 #, c-format
 msgid "Unable to convert characters from %s to %s."
 msgstr "Kan inte konvertera tecken från %s till %s."
 
-#: src/vte.c:4409
+#: src/vte.c:4546
 #, c-format
 msgid "Got unexpected (key?) sequence `%s'."
 msgstr "Fick oväntad (tangent?)sekvens \"%s\"."
 
-#: src/vte.c:5133
+#: src/vte.c:5277
 #, c-format
 msgid "Character 0x%x is undefined, allocating one column."
 msgstr "Tecknet 0x%x är odefinierat, allokerar en kolumn."
 
-#: src/vte.c:5324
+#: src/vte.c:5468
 #, c-format
 msgid "No handler for control sequence `%s' defined."
 msgstr "Ingen hanterare för kontrollsekvensen \"%s\" är angiven."
 
-#: src/vte.c:5955
+#: src/vte.c:6003
 #, c-format
 msgid "Error reading from child: %s."
 msgstr "Fel vid läsning från barn: %s."
 
-#: src/vte.c:6123
+#: src/vte.c:6171
 #, c-format
 msgid "Error (%s) converting data for child, dropping."
 msgstr "Fel (%s) vid konvertering av data för barn, kastar."
 
-#: src/vte.c:7867
+#: src/vte.c:7915
 #, c-format
 msgid ""
 "Warning: using fontset \"%s\", which is missing these character sets: %s."
@@ -78,49 +78,49 @@ msgstr ""
 "Varning: använder typsnittssamlingen \"%s\", som saknar dessa "
 "teckensamlingar: %s."
 
-#: src/vte.c:8411
+#: src/vte.c:8459
 #, c-format
 msgid "Failed to load Xft font pattern \"%s\", falling back to default font."
 msgstr ""
 "Misslyckades med att läsa in XFt-typsnittsmönstret \"%s\", använder "
 "standardtypsnittet."
 
-#: src/vte.c:8424
+#: src/vte.c:8472
 msgid "Failed to load default Xft font."
 msgstr "Misslyckades med att läsa in Xft-standardtypsnittet."
 
-#: src/vte.c:8467
+#: src/vte.c:8515
 msgid "Error allocating Xft font, disabling Xft."
 msgstr "Fel vid allokering av Xft-typsnitt, deaktiverar Xft."
 
-#: src/vte.c:8491
+#: src/vte.c:8539
 #, c-format
 msgid "Failed to load font set \"%s\", falling back to default font."
 msgstr ""
 "Misslyckades med att läsa in typsnittssamlingen \"%s\", använder "
 "standardtypsnittet."
 
-#: src/vte.c:8503
+#: src/vte.c:8551
 msgid "Failed to load default font, crashing or behaving abnormally."
 msgstr ""
 "Misslyckades med att läsa in standardtypsnittet, kraschar eller beter sig "
 "onormalt."
 
-#: src/vte.c:8586
+#: src/vte.c:8634
 #, c-format
 msgid "Error reading PTY size, using defaults: %s."
 msgstr "Fel vid läsande av PTY-storlek, använder standardvärden: %s."
 
-#: src/vte.c:10728
+#: src/vte.c:10776
 msgid "Error allocating layout, disabling Pango."
 msgstr "Fel vid allokering av layout, deaktiverar Pango."
 
-#: src/vte.c:10738
+#: src/vte.c:10786
 msgid "Error allocating draw, disabling Xft."
 msgstr "Fel vid allokering av ritbar yta, deaktiverar Xft."
 
 #. Aaargh.  We're screwed.
-#: src/vte.c:11957
+#: src/vte.c:12014
 msgid "g_iconv_open() failed setting word characters"
 msgstr "g_iconv_open() misslyckades med att ställa in ordtecken"
 
index e0316ff..cca94b9 100644 (file)
@@ -2,7 +2,7 @@ bin_PROGRAMS = vte
 pkginclude_HEADERS = caps.h pty.h ring.h termcap.h trie.h vte.h vteaccess.h
 lib_LTLIBRARIES = libvte.la
 pkglib_PROGRAMS = interpret utf8echo utf8mode iso8859mode slowcat
-EXTRA_PROGRAMS = pty reaper ring termcap trie
+EXTRA_PROGRAMS = pty reaper ring table termcap trie
 EXTRA_DIST = marshal.list
 
 CFLAGS = @CFLAGS@ @XFT_CFLAGS@ @GTK_CFLAGS@ @X_CFLAGS@
@@ -20,6 +20,8 @@ libvte_la_SOURCES = \
        reaper.h \
        ring.c \
        ring.h \
+       table.c \
+       table.h \
        termcap.c \
        termcap.h \
        trie.c \
@@ -30,7 +32,7 @@ libvte_la_SOURCES = \
        vteaccess.h
 
 libvte_la_LIBADD = @LIBS@ @XFT_LIBS@ @GTK_LIBS@ @X_LIBS@
-libvte_la_LDFLAGS = -version-info 3:0:1
+libvte_la_LDFLAGS = -version-info 4:0:2
 
 CLEANFILES = marshal.c marshal.h
 
@@ -48,10 +50,10 @@ interpret_SOURCES = \
        caps.h \
        debug.c \
        debug.h \
+       table.c \
+       table.h \
        termcap.c \
        termcap.h \
-       trie.c \
-       trie.h \
        interpret.c
 interpret_LDADD = @GLIB_LIBS@
 
@@ -59,8 +61,8 @@ utf8echo_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DUTF8ECHO_MAIN
 utf8echo_SOURCES = \
        debug.c \
        debug.h \
-       trie.c \
-       trie.h \
+       table.c \
+       table.h \
        utf8echo.c
 utf8echo_LDADD = @LIBS@ @GLIB_LIBS@
 
@@ -76,10 +78,20 @@ slowcat_SOURCES = \
        slowcat.c
 slowcat_LDADD = @LIBS@ @GLIB_LIBS@
 
+table_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DTABLE_MAIN
+table_SOURCES = \
+       debug.c \
+       debug.h \
+       table.c \
+       table.h
+table_LDADD = @LIBS@ @GLIB_LIBS@
+
 trie_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DTRIE_MAIN
 trie_SOURCES = \
        debug.c \
        debug.h \
+       table.c \
+       table.h \
        termcap.c \
        termcap.h \
        trie.c \
@@ -104,6 +116,8 @@ pty_LDADD = @LIBS@ @GLIB_LIBS@
 
 reaper_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DREAPER_MAIN
 reaper_SOURCES = \
+       debug.c \
+       debug.h \
        marshal.c \
        marshal.h \
        reaper.c \
index 7342408..c078176 100644 (file)
 /* This list combined from the Linux termcap(5) man page, and
  * termcap_&_terminfo by Strang, Mui, and O'Reilly. */
 struct vte_capability_quark vte_terminal_capability_strings[] = {
-       {"!1", 0},
-       {"!2", 0},
-       {"!3", 0},
-
-       {"#1", 0},
-       {"#2", 0},
-       {"#3", 0},
-       {"#4", 0},
-
-       {"%0", 0},
-       {"%1", 0},
-       {"%2", 0},
-       {"%3", 0},
-       {"%4", 0},
-       {"%5", 0},
-       {"%6", 0},
-       {"%7", 0},
-       {"%8", 0},
-       {"%9", 0},
-       {"%a", 0},
-       {"%b", 0},
-       {"%c", 0},
-       {"%d", 0},
-       {"%e", 0},
-       {"%f", 0},
-       {"%g", 0},
-       {"%h", 0},
-       {"%i", 0},
-       {"%j", 0},
-
-       {"&0", 0},
-       {"&1", 0},
-       {"&2", 0},
-       {"&3", 0},
-       {"&4", 0},
-       {"&5", 0},
-       {"&6", 0},
-       {"&7", 0},
-       {"&8", 0},
-       {"&9", 0},
-
-       {"*0", 0},
-       {"*1", 0},
-       {"*2", 0},
-       {"*3", 0},
-       {"*4", 0},
-       {"*5", 0},
-       {"*6", 0},
-       {"*7", 0},
-       {"*8", 0},
-       {"*9", 0},
-
-       {"@0", 0},
-       {"@1", 0},
-       {"@2", 0},
-       {"@3", 0},
-       {"@4", 0},
-       {"@5", 0},
-       {"@6", 0},
-       {"@7", 0},
-       {"@8", 0},
-       {"@9", 0},
-
-       {"ae", 0},
-       {"al", 0},
-       {"AL", 0},
-       {"as", 0},
-
-       {"bc", 0},
-       {"bl", 0},
-       {"bt", 0},
-
-       {"cb", 0},
-       {"cc", 0},
-       {"cd", 0},
-       {"ce", 0},
-       {"ch", 0},
-       {"cl", 0},
-       {"cm", 0},
-       {"CM", 0},
-       {"cr", 0},
-       {"cs", 0},
-       {"ct", 0},
-       {"cv", 0},
-
-       {"dc", 0},
-       {"DC", 0},
-       {"dl", 0},
-       {"DL", 0},
-       {"dm", 0},
-       {"do", 0},
-       {"DO", 0},
-       {"ds", 0},
-
-       {"eA", 0},
-       {"ec", 0},
-       {"ed", 0},
-       {"ei", 0},
-
-       {"F1", 0},
-       {"F2", 0},
-       {"F3", 0},
-       {"F4", 0},
-       {"F5", 0},
-       {"F6", 0},
-       {"F7", 0},
-       {"F8", 0},
-       {"F9", 0},
-       {"FA", 0},
-       {"FB", 0},
-       {"FC", 0},
-       {"FD", 0},
-       {"FE", 0},
-       {"FF", 0},
-       {"FG", 0},
-       {"FH", 0},
-       {"FI", 0},
-       {"FJ", 0},
-       {"FK", 0},
-       {"FL", 0},
-       {"FM", 0},
-       {"FN", 0},
-       {"FO", 0},
-       {"FP", 0},
-       {"FQ", 0},
-       {"FR", 0},
-       {"FS", 0},
-       {"FT", 0},
-       {"FU", 0},
-       {"FV", 0},
-       {"FW", 0},
-       {"FX", 0},
-       {"FY", 0},
-       {"FZ", 0},
-
-       {"Fa", 0},
-       {"Fb", 0},
-       {"Fc", 0},
-       {"Fd", 0},
-       {"Fe", 0},
-       {"Ff", 0},
-       {"Fg", 0},
-       {"Fh", 0},
-       {"Fi", 0},
-       {"Fj", 0},
-       {"Fk", 0},
-       {"Fl", 0},
-       {"Fm", 0},
-       {"Fn", 0},
-       {"Fo", 0},
-       {"Fp", 0},
-       {"Fq", 0},
-       {"Fr", 0},
-
-       {"ff", 0},
-       {"fs", 0},
-
-       {"hd", 0},
-       {"ho", 0},
-       {"hu", 0},
-
-       {"i1", 0},
-       {"i3", 0},
-
-       {"ic", 0},
-       {"IC", 0},
-       {"if", 0},
-       {"im", 0},
-       {"ip", 0},
-       {"iP", 0},
-       {"is", 0},
-
-       {"K1", 0},
-       {"K2", 0},
-       {"K3", 0},
-       {"K4", 0},
-       {"K5", 0},
-
-       {"k0", 0},
-       {"k1", 0},
-       {"k2", 0},
-       {"k3", 0},
-       {"k4", 0},
-       {"k5", 0},
-       {"k6", 0},
-       {"k7", 0},
-       {"k8", 0},
-       {"k9", 0},
-       {"k;", 0},
-       {"ka", 0},
-       {"kA", 0},
-       {"kb", 0},
-       {"kB", 0},
-       {"kC", 0},
-       {"kd", 0},
-       {"kD", 0},
-       {"ke", 0},
-       {"kE", 0},
-       {"kF", 0},
-       {"kh", 0},
-       {"kH", 0},
-       {"kI", 0},
-       {"kl", 0},
-       {"kL", 0},
-       {"kM", 0},
-       {"kN", 0},
-       {"kP", 0},
-       {"kr", 0},
-       {"kR", 0},
-       {"ks", 0},
-       {"kS", 0},
-       {"kt", 0},
-       {"kT", 0},
-       {"ku", 0},
-
-       {"l0", 0},
-       {"l1", 0},
-       {"l2", 0},
-       {"l3", 0},
-       {"l4", 0},
-       {"l5", 0},
-       {"l6", 0},
-       {"l7", 0},
-       {"l8", 0},
-       {"l9", 0},
-
-       {"la", 0},
-       {"le", 0},
-       {"LE", 0},
-       {"LF", 0},
-       {"ll", 0},
-       {"LO", 0},
-
-       {"mb", 0},
-       {"MC", 0},
-       {"md", 0},
-       {"me", 0},
-       {"mh", 0},
-       {"mk", 0},
-       {"ml", 0},
-       {"ML", 0},
-       {"mm", 0},
-       {"mo", 0},
-       {"mp", 0},
-       {"mr", 0},
-       {"MR", 0},
-       {"mu", 0},
-
-       {"nd", 0},
-       {"nl", 0},
-       {"nw", 0},
-
-       {"pc", 0},
-       {"pf", 0},
-       {"pk", 0},
-       {"pl", 0},
-       {"pn", 0},
-       {"po", 0},
-       {"pO", 0},
-       {"ps", 0},
-       {"px", 0},
-
-       {"r1", 0},
-       {"r2", 0},
-       {"r3", 0},
-
-       {"RA", 0},
-       {"rc", 0},
-       {"rf", 0},
-       {"RF", 0},
-       {"RI", 0},
-       {"rp", 0},
-       {"rP", 0},
-       {"rs", 0},
-       {"RX", 0},
-
-       {"s0", 0},
-       {"s1", 0},
-       {"s2", 0},
-       {"s3", 0},
-
-       {"sa", 0},
-       {"SA", 0},
-       {"sc", 0},
-       {"se", 0},
-       {"sf", 0},
-       {"SF", 0},
+       {"!1", TRUE, 0},
+       {"!2", TRUE, 0},
+       {"!3", TRUE, 0},
+
+       {"#1", TRUE, 0},
+       {"#2", TRUE, 0},
+       {"#3", TRUE, 0},
+       {"#4", TRUE, 0},
+
+       {"%0", TRUE, 0},
+       {"%1", TRUE, 0},
+       {"%2", TRUE, 0},
+       {"%3", TRUE, 0},
+       {"%4", TRUE, 0},
+       {"%5", TRUE, 0},
+       {"%6", TRUE, 0},
+       {"%7", TRUE, 0},
+       {"%8", TRUE, 0},
+       {"%9", TRUE, 0},
+       {"%a", TRUE, 0},
+       {"%b", TRUE, 0},
+       {"%c", TRUE, 0},
+       {"%d", TRUE, 0},
+       {"%e", TRUE, 0},
+       {"%f", TRUE, 0},
+       {"%g", TRUE, 0},
+       {"%h", TRUE, 0},
+       {"%i", TRUE, 0},
+       {"%j", TRUE, 0},
+
+       {"&0", TRUE, 0},
+       {"&1", TRUE, 0},
+       {"&2", TRUE, 0},
+       {"&3", TRUE, 0},
+       {"&4", TRUE, 0},
+       {"&5", TRUE, 0},
+       {"&6", TRUE, 0},
+       {"&7", TRUE, 0},
+       {"&8", TRUE, 0},
+       {"&9", TRUE, 0},
+
+       {"*0", TRUE, 0},
+       {"*1", TRUE, 0},
+       {"*2", TRUE, 0},
+       {"*3", TRUE, 0},
+       {"*4", TRUE, 0},
+       {"*5", TRUE, 0},
+       {"*6", TRUE, 0},
+       {"*7", TRUE, 0},
+       {"*8", TRUE, 0},
+       {"*9", TRUE, 0},
+
+       {"@0", TRUE, 0},
+       {"@1", TRUE, 0},
+       {"@2", TRUE, 0},
+       {"@3", TRUE, 0},
+       {"@4", TRUE, 0},
+       {"@5", TRUE, 0},
+       {"@6", TRUE, 0},
+       {"@7", TRUE, 0},
+       {"@8", TRUE, 0},
+       {"@9", TRUE, 0},
+
+       {"ae", FALSE, 0},
+       {"al", FALSE, 0},
+       {"AL", FALSE, 0},
+       {"as", FALSE, 0},
+
+       {"bc", FALSE, 0},
+       {"bl", FALSE, 0},
+       {"bt", FALSE, 0},
+
+       {"cb", FALSE, 0},
+       {"cc", FALSE, 0},
+       {"cd", FALSE, 0},
+       {"ce", FALSE, 0},
+       {"ch", FALSE, 0},
+       {"cl", FALSE, 0},
+       {"cm", FALSE, 0},
+       {"CM", FALSE, 0},
+       {"cr", FALSE, 0},
+       {"cs", FALSE, 0},
+       {"ct", FALSE, 0},
+       {"cv", FALSE, 0},
+
+       {"dc", FALSE, 0},
+       {"DC", FALSE, 0},
+       {"dl", FALSE, 0},
+       {"DL", FALSE, 0},
+       {"dm", FALSE, 0},
+       {"do", FALSE, 0},
+       {"DO", FALSE, 0},
+       {"ds", FALSE, 0},
+
+       {"eA", FALSE, 0},
+       {"ec", FALSE, 0},
+       {"ed", FALSE, 0},
+       {"ei", FALSE, 0},
+
+       {"F1", TRUE, 0},
+       {"F2", TRUE, 0},
+       {"F3", TRUE, 0},
+       {"F4", TRUE, 0},
+       {"F5", TRUE, 0},
+       {"F6", TRUE, 0},
+       {"F7", TRUE, 0},
+       {"F8", TRUE, 0},
+       {"F9", TRUE, 0},
+       {"FA", TRUE, 0},
+       {"FB", TRUE, 0},
+       {"FC", TRUE, 0},
+       {"FD", TRUE, 0},
+       {"FE", TRUE, 0},
+       {"FF", TRUE, 0},
+       {"FG", TRUE, 0},
+       {"FH", TRUE, 0},
+       {"FI", TRUE, 0},
+       {"FJ", TRUE, 0},
+       {"FK", TRUE, 0},
+       {"FL", TRUE, 0},
+       {"FM", TRUE, 0},
+       {"FN", TRUE, 0},
+       {"FO", TRUE, 0},
+       {"FP", TRUE, 0},
+       {"FQ", TRUE, 0},
+       {"FR", TRUE, 0},
+       {"FS", TRUE, 0},
+       {"FT", TRUE, 0},
+       {"FU", TRUE, 0},
+       {"FV", TRUE, 0},
+       {"FW", TRUE, 0},
+       {"FX", TRUE, 0},
+       {"FY", TRUE, 0},
+       {"FZ", TRUE, 0},
+
+       {"Fa", TRUE, 0},
+       {"Fb", TRUE, 0},
+       {"Fc", TRUE, 0},
+       {"Fd", TRUE, 0},
+       {"Fe", TRUE, 0},
+       {"Ff", TRUE, 0},
+       {"Fg", TRUE, 0},
+       {"Fh", TRUE, 0},
+       {"Fi", TRUE, 0},
+       {"Fj", TRUE, 0},
+       {"Fk", TRUE, 0},
+       {"Fl", TRUE, 0},
+       {"Fm", TRUE, 0},
+       {"Fn", TRUE, 0},
+       {"Fo", TRUE, 0},
+       {"Fp", TRUE, 0},
+       {"Fq", TRUE, 0},
+       {"Fr", TRUE, 0},
+
+       {"ff", FALSE, 0},
+       {"fs", FALSE, 0},
+
+       {"hd", FALSE, 0},
+       {"ho", FALSE, 0},
+       {"hu", FALSE, 0},
+
+       {"i1", FALSE, 0},
+       {"i3", FALSE, 0},
+
+       {"ic", FALSE, 0},
+       {"IC", FALSE, 0},
+       {"if", FALSE, 0},
+       {"im", FALSE, 0},
+       {"ip", FALSE, 0},
+       {"iP", FALSE, 0},
+       {"is", FALSE, 0},
+
+       {"K1", TRUE, 0},
+       {"K2", TRUE, 0},
+       {"K3", TRUE, 0},
+       {"K4", TRUE, 0},
+       {"K5", TRUE, 0},
+
+       {"k0", TRUE, 0},
+       {"k1", TRUE, 0},
+       {"k2", TRUE, 0},
+       {"k3", TRUE, 0},
+       {"k4", TRUE, 0},
+       {"k5", TRUE, 0},
+       {"k6", TRUE, 0},
+       {"k7", TRUE, 0},
+       {"k8", TRUE, 0},
+       {"k9", TRUE, 0},
+       {"k;", TRUE, 0},
+       {"ka", TRUE, 0},
+       {"kA", TRUE, 0},
+       {"kb", TRUE, 0},
+       {"kB", TRUE, 0},
+       {"kC", TRUE, 0},
+       {"kd", TRUE, 0},
+       {"kD", TRUE, 0},
+       {"ke", TRUE, 0},
+       {"kE", TRUE, 0},
+       {"kF", TRUE, 0},
+       {"kh", TRUE, 0},
+       {"kH", TRUE, 0},
+       {"kI", TRUE, 0},
+       {"kl", TRUE, 0},
+       {"kL", TRUE, 0},
+       {"kM", TRUE, 0},
+       {"kN", TRUE, 0},
+       {"kP", TRUE, 0},
+       {"kr", TRUE, 0},
+       {"kR", TRUE, 0},
+       {"ks", TRUE, 0},
+       {"kS", TRUE, 0},
+       {"kt", TRUE, 0},
+       {"kT", TRUE, 0},
+       {"ku", TRUE, 0},
+
+       {"l0", FALSE, 0},
+       {"l1", FALSE, 0},
+       {"l2", FALSE, 0},
+       {"l3", FALSE, 0},
+       {"l4", FALSE, 0},
+       {"l5", FALSE, 0},
+       {"l6", FALSE, 0},
+       {"l7", FALSE, 0},
+       {"l8", FALSE, 0},
+       {"l9", FALSE, 0},
+
+       {"la", FALSE, 0},
+       {"le", FALSE, 0},
+       {"LE", FALSE, 0},
+       {"LF", FALSE, 0},
+       {"ll", FALSE, 0},
+       {"LO", FALSE, 0},
+
+       {"mb", FALSE, 0},
+       {"MC", FALSE, 0},
+       {"md", FALSE, 0},
+       {"me", FALSE, 0},
+       {"mh", FALSE, 0},
+       {"mk", FALSE, 0},
+       {"ml", FALSE, 0},
+       {"ML", FALSE, 0},
+       {"mm", FALSE, 0},
+       {"mo", FALSE, 0},
+       {"mp", FALSE, 0},
+       {"mr", FALSE, 0},
+       {"MR", FALSE, 0},
+       {"mu", FALSE, 0},
+
+       {"nd", FALSE, 0},
+       {"nl", FALSE, 0},
+       {"nw", FALSE, 0},
+
+       {"pc", FALSE, 0},
+       {"pf", FALSE, 0},
+       {"pk", FALSE, 0},
+       {"pl", FALSE, 0},
+       {"pn", FALSE, 0},
+       {"po", FALSE, 0},
+       {"pO", FALSE, 0},
+       {"ps", FALSE, 0},
+       {"px", FALSE, 0},
+
+       {"r1", FALSE, 0},
+       {"r2", FALSE, 0},
+       {"r3", FALSE, 0},
+
+       {"RA", FALSE, 0},
+       {"rc", FALSE, 0},
+       {"rf", FALSE, 0},
+       {"RF", FALSE, 0},
+       {"RI", FALSE, 0},
+       {"rp", FALSE, 0},
+       {"rP", FALSE, 0},
+       {"rs", FALSE, 0},
+       {"RX", FALSE, 0},
+
+       {"s0", FALSE, 0},
+       {"s1", FALSE, 0},
+       {"s2", FALSE, 0},
+       {"s3", FALSE, 0},
+
+       {"sa", FALSE, 0},
+       {"SA", FALSE, 0},
+       {"sc", FALSE, 0},
+       {"se", FALSE, 0},
+       {"sf", FALSE, 0},
+       {"SF", FALSE, 0},
        /* {"so", 0}, standout is always the same as another attribute. */
-       {"sr", 0},
-       {"SR", 0},
-       {"st", 0},
-       {"SX", 0},
+       {"sr", FALSE, 0},
+       {"SR", FALSE, 0},
+       {"st", FALSE, 0},
+       {"SX", FALSE, 0},
 
-       {"ta", 0},
+       {"ta", FALSE, 0},
        /* {"te", 0}, terminal end-use is "logical". */
        /* {"ti", 0}, terminal init is "logical". */
-       {"ts", 0},
+       {"ts", FALSE, 0},
 
-       {"uc", 0},
-       {"ue", 0},
-       {"up", 0},
-       {"UP", 0},
-       {"us", 0},
+       {"uc", FALSE, 0},
+       {"ue", FALSE, 0},
+       {"up", FALSE, 0},
+       {"UP", FALSE, 0},
+       {"us", FALSE, 0},
 
-       {"vb", 0},
+       {"vb", FALSE, 0},
        /* {"ve", 0}, */
        {"vi", 0},
-       /* {"vs", 0}, */
+       /* {"vsFALSE, ", 0}, */
 
-       {"wi", 0},
+       {"wi", FALSE, 0},
 
-       {"XF", 0},
-       {"XN", 0},
+       {"XF", FALSE, 0},
+       {"XN", FALSE, 0},
 
-       {NULL, 0},
+       {NULL, FALSE, 0},
 };
 
 /* From some really old XTerm docs we had at the office, and an updated
index 71b0019..5bfe422 100644 (file)
@@ -36,6 +36,7 @@ G_BEGIN_DECLS
  * which means they're either key sequences or commands. */
 struct vte_capability_quark {
        const char *capability;
+       gboolean key;
        GQuark quark;
 };
 struct vte_capability_string {
index cdac398..5da6df7 100644 (file)
 #include "caps.h"
 #include "debug.h"
 #include "termcap.h"
-#include "trie.h"
+#include "table.h"
 
 int
 main(int argc, char **argv)
 {
        char *terminal = NULL;
-       struct vte_trie *trie = NULL;
+       struct vte_table *table = NULL;
        struct vte_termcap *termcap = NULL;
        GByteArray *array = NULL;
        int i;
@@ -54,7 +54,7 @@ main(int argc, char **argv)
                return 1;
        }
 
-       if (argc > 2) {
+       if ((argc > 2) && (strcmp(argv[2], "-") != 0)) {
                infile = fopen(argv[2], "r");
                if (infile == NULL) {
                        g_print("error opening %s: %s\n", argv[2],
@@ -67,7 +67,7 @@ main(int argc, char **argv)
 
        g_type_init();
        terminal = argv[1];
-       trie = vte_trie_new();
+       table = vte_table_new();
        termcap = vte_termcap_new("/etc/termcap");
        array = g_byte_array_new();
 
@@ -77,10 +77,13 @@ main(int argc, char **argv)
                const char *capability;
                char *tmp;
                capability = vte_terminal_capability_strings[i].capability;
+               if (vte_terminal_capability_strings[i].key) {
+                       continue;
+               }
                tmp = vte_termcap_find_string(termcap, terminal, capability);
                if ((tmp != NULL) && (strlen(tmp) > 0)) {
-                       vte_trie_add(trie, tmp, strlen(tmp), capability,
-                                    g_quark_from_static_string(capability));
+                       vte_table_add(table, tmp, strlen(tmp), capability,
+                                     g_quark_from_static_string(capability));
                }
                g_free(tmp);
        }
@@ -88,8 +91,8 @@ main(int argc, char **argv)
                const char *code, *value;
                code = vte_xterm_capability_strings[i].code;
                value = vte_xterm_capability_strings[i].value;
-               vte_trie_add(trie, code, strlen(code), value,
-                            g_quark_from_static_string(code));
+               vte_table_add(table, code, strlen(code), value,
+                             g_quark_from_static_string(code));
        }
 
        while (fread(&c, 1, 1, infile) == 1) {
@@ -102,7 +105,7 @@ main(int argc, char **argv)
                        gunichar *ubuf;
                        gsize ubuflen;
                        ubuf = (gunichar*) g_convert(array->data, i,
-                                                    vte_trie_wide_encoding(),
+                                                    vte_table_wide_encoding(),
                                                     "UTF-8",
                                                     NULL, &ubuflen, &error);
                        if (error != NULL) {
@@ -110,8 +113,8 @@ main(int argc, char **argv)
                                        error->message ? error->message : "?");
                                g_clear_error(&error);
                        }
-                       vte_trie_match(trie, ubuf, ubuflen / sizeof(gunichar),
-                                      &tmp, NULL, &quark, &values);
+                       vte_table_match(table, ubuf, ubuflen / sizeof(gunichar),
+                                       &tmp, NULL, &quark, &values);
                        if (tmp != NULL) {
                                if (strlen(tmp) > 0) {
                                        int j;
@@ -158,6 +161,6 @@ main(int argc, char **argv)
 
        g_byte_array_free(array, TRUE);
        vte_termcap_free(termcap);
-       vte_trie_free(trie);
+       vte_table_free(table);
        return 0;
 }
index 31f18c1..8f8ab95 100644 (file)
--- a/src/pty.c
+++ b/src/pty.c
@@ -261,7 +261,7 @@ main(int argc, char **argv)
        int fd;
        char c;
        vte_debug_parse_string(getenv("VTE_DEBUG_FLAGS"));
-       fd = vte_pty_open(&child, "/usr/bin/tty");
+       fd = vte_pty_open(&child, NULL, "/usr/bin/tty", NULL, 0, 0);
        g_print("Child pid is %d.\n", (int)child);
        while(read(fd, &c, 1) == 1) {
                write(STDOUT_FILENO, &c, 1);
index 6053be2..80153e5 100644 (file)
@@ -20,6 +20,7 @@
 #include "../config.h"
 #include <sys/wait.h>
 #include <signal.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <glib.h>
 #include <glib-object.h>
index 4789d1c..2f41314 100644 (file)
@@ -50,8 +50,8 @@ enum vte_table_specials {
 struct vte_table {
        GQuark resultq;
        const char *result;
-       GQuark originalq;
-       const char *original;
+       unsigned char *original;
+       size_t original_length;
        int increment;
        struct vte_table *table[vte_table_max];
 };
@@ -86,13 +86,17 @@ vte_table_free(struct vte_table *table)
                        table->table[i] = NULL;
                }
        }
+       if (table->original != NULL) {
+               g_free(table->original);
+               table->original = NULL;
+       }
        g_free(table);
 }
 
 /* Add a string to the tree with the given increment value. */
 static void
 vte_table_addi(struct vte_table *table,
-              const unsigned char *original,
+              const unsigned char *original, size_t original_length,
               const unsigned char *pattern, size_t length,
               const char *result, GQuark quark, int inc)
 {
@@ -111,8 +115,9 @@ vte_table_addi(struct vte_table *table,
 #endif
                table->resultq = g_quark_from_string(result);
                table->result = g_quark_to_string(table->resultq);
-               table->originalq = g_quark_from_string(original);
-               table->original = g_quark_to_string(table->originalq);
+               table->original = g_malloc(original_length);
+               table->original_length = original_length;
+               memcpy(table->original, original, original_length);
                table->increment = inc;
                return;
        }
@@ -121,7 +126,7 @@ vte_table_addi(struct vte_table *table,
        if (pattern[0] == '%') {
                /* Handle an increment. */
                if (pattern[1] == 'i') {
-                       vte_table_addi(table, original,
+                       vte_table_addi(table, original, original_length,
                                       pattern + 2, length - 2,
                                       result, quark, inc + 1);
                        return;
@@ -139,7 +144,7 @@ vte_table_addi(struct vte_table *table,
                                subtable = table->table[vte_table_number];
                        }
                        /* Add the rest of the string to the subtable. */
-                       vte_table_addi(subtable, original,
+                       vte_table_addi(subtable, original, original_length,
                                       pattern + 2, length - 2,
                                       result, quark, inc);
                        return;
@@ -157,7 +162,7 @@ vte_table_addi(struct vte_table *table,
                                subtable = table->table[vte_table_string];
                        }
                        /* Add the rest of the string to the subtable. */
-                       vte_table_addi(subtable, original,
+                       vte_table_addi(subtable, original, original_length,
                                       pattern + 2, length - 2,
                                       result, quark, inc);
                        return;
@@ -173,7 +178,7 @@ vte_table_addi(struct vte_table *table,
                                subtable = table->table['%'];
                        }
                        /* Add the rest of the string to the subtable. */
-                       vte_table_addi(subtable, original,
+                       vte_table_addi(subtable, original, original_length,
                                       pattern + 2, length - 2,
                                       result, quark, inc);
                        return;
@@ -194,7 +199,8 @@ vte_table_addi(struct vte_table *table,
                                        subtable = table->table[i];
                                }
                                /* Add the rest of the string to the subtable. */
-                               vte_table_addi(subtable, original,
+                               vte_table_addi(subtable,
+                                              original, original_length,
                                               pattern + 3, length - 3,
                                               result, quark, inc);
                        }
@@ -206,7 +212,7 @@ vte_table_addi(struct vte_table *table,
                                subtable = table->table[0];
                        }
                        /* Add the rest of the string to the subtable. */
-                       vte_table_addi(subtable, original,
+                       vte_table_addi(subtable, original, original_length,
                                       pattern + 3, length - 3,
                                       result, quark, inc);
                        return;
@@ -222,7 +228,7 @@ vte_table_addi(struct vte_table *table,
                subtable = table->table[pattern[0]];
        }
        /* Add the rest of the string to the subtable. */
-       vte_table_addi(subtable, original,
+       vte_table_addi(subtable, original, original_length,
                       pattern + 1, length - 1,
                       result, quark, inc);
 }
@@ -236,29 +242,20 @@ vte_table_add(struct vte_table *table,
        unsigned char *pattern_copy, *p;
        pattern_copy = g_strndup(pattern, length);
        /* Collapse as many numeric parameters as possible into '%m'. */
-       while ((p = strstr(pattern_copy, "%d;%d")) != NULL) {
-               strcpy(p, p + 3);
-       }
-       while ((p = strstr(pattern_copy, "%2;%d")) != NULL) {
-               strcpy(p, p + 3);
-       }
-       while ((p = strstr(pattern_copy, "%d;%2")) != NULL) {
-               strcpy(p, p + 3);
-       }
-       while ((p = strstr(pattern_copy, "%2;%2")) != NULL) {
-               strcpy(p, p + 3);
-       }
        while ((p = strstr(pattern_copy, "%d")) != NULL) {
                memcpy(p, "%m", 2);
        }
+       while ((p = strstr(pattern_copy, "%3")) != NULL) {
+               memcpy(p, "%m", 2);
+       }
        while ((p = strstr(pattern_copy, "%2")) != NULL) {
                memcpy(p, "%m", 2);
        }
        while ((p = strstr(pattern_copy, "%m;%m")) != NULL) {
-               strcpy(p, p + 3);
+               memmove(p, p + 3, length - 3 - (p - pattern_copy));
+               length -= 3;
        }
-       vte_table_addi(table, pattern_copy,
-                      pattern_copy, strlen(pattern_copy),
+       vte_table_addi(table, pattern_copy, length, pattern_copy, length,
                       result, quark, 0);
        g_free(pattern_copy);
 }
@@ -267,8 +264,9 @@ vte_table_add(struct vte_table *table,
 static const char *
 vte_table_matchi(struct vte_table *table,
                 const gunichar *pattern, size_t length,
-                const char **res, const gunichar **consumed,
-                GQuark *quark, const char **original, GList **params)
+                const char **res, const gunichar **consumed, GQuark *quark,
+                unsigned char **original, size_t *original_length,
+                GList **params)
 {
        int i = 0;
        struct vte_table *subtable = NULL;
@@ -278,6 +276,7 @@ vte_table_matchi(struct vte_table *table,
        if (table->result != NULL) {
                *consumed = pattern;
                *original = table->original;
+               *original_length = table->original_length;
                *res = table->result;
                *quark = table->resultq;
                return table->result;
@@ -307,7 +306,8 @@ vte_table_matchi(struct vte_table *table,
                *params = g_list_append(*params, arginfo);
                /* Continue. */
                return vte_table_matchi(subtable, pattern + i, length - i,
-                                       res, consumed, quark, original, params);
+                                       res, consumed, quark,
+                                       original, original_length, params);
        }
 
        /* Check if this could be a number. */
@@ -328,7 +328,8 @@ vte_table_matchi(struct vte_table *table,
                *params = g_list_append(*params, arginfo);
                /* Continue. */
                return vte_table_matchi(subtable, pattern + i, length - i,
-                                       res, consumed, quark, original, params);
+                                       res, consumed, quark,
+                                       original, original_length, params);
        }
 
        /* Check for an exact match. */
@@ -342,7 +343,8 @@ vte_table_matchi(struct vte_table *table,
                *params = g_list_append(*params, arginfo);
                /* Continue. */
                return vte_table_matchi(subtable, pattern + 1, length - 1,
-                                       res, consumed, quark, original, params);
+                                       res, consumed, quark,
+                                       original, original_length, params);
        }
 
        /* If there's nothing else to do, then we can't go on.  Keep track of
@@ -435,8 +437,9 @@ vte_table_match(struct vte_table *table,
        GQuark dummy_quark = 0;
        GValueArray *dummy_array = NULL;
        GValue *value;
-       const char *ret = NULL, *p;
-       const char *original = NULL;
+       const char *ret = NULL;
+       unsigned char *original = NULL, *p = NULL;
+       size_t original_length;
        GList *params = NULL, *tmp;
        long increment = 0;
        int i;
@@ -494,7 +497,9 @@ vte_table_match(struct vte_table *table,
 
        /* Check for a pattern match. */
        ret = vte_table_matchi(table, pattern, length,
-                              res, consumed, quark, &original, &params);
+                              res, consumed, quark,
+                              &original, &original_length,
+                              &params);
        *res = ret;
 
        /* If we got a match, extract the parameters. */
@@ -502,7 +507,7 @@ vte_table_match(struct vte_table *table,
                tmp = params;
                g_assert(original != NULL);
                p = original;
-               while (*p != '\0') {
+               while (p < original + original_length) {
                        /* All of the interesting arguments begin with '%'. */
                        if (p[0] == '%') {
                                /* Handle an increment. */
index ecd341e..50abc2a 100644 (file)
@@ -32,6 +32,8 @@
 #include "termcap.h"
 #endif
 
+#include "debug.h"
+
 struct vte_termcap {
        char *comment;
        struct vte_termcap_entry {
index c63f683..ec510ed 100644 (file)
 #include <glib.h>
 #include <glib-object.h>
 #include "debug.h"
+#include "table.h"
 #include "trie.h"
 
+#ifndef HAVE_WINT_T
+typedef long wint_t;
+#endif
+
 #ifdef ENABLE_NLS
 #include <libintl.h>
 #define _(String) dgettext(PACKAGE, String)
@@ -78,11 +83,6 @@ struct char_class {
                                        /* Extract a parameter. */
 };
 
-/* A table to hold shortcuts. */
-struct vte_trie_table {
-       struct trie_path *paths[128];
-};
-
 /* A trie to hold control sequences. */
 struct vte_trie {
        const char *result;             /* If this is a terminal node, then this
@@ -96,8 +96,6 @@ struct vte_trie {
                struct vte_trie *trie;  /* The child node corresponding to this
                                           character. */
        } *trie_paths;
-       struct vte_trie_table *table;   /* A table filled with pointers to the
-                                          child nodes. */
 };
 
 /* Functions for checking if a particular character is part of a class, and
@@ -379,10 +377,6 @@ vte_trie_free(struct vte_trie *trie)
        if (trie->trie_path_count > 0) {
                g_free(trie->trie_paths);
        }
-       if (trie->table != NULL) {
-               g_free(trie->table);
-               trie->table = NULL;
-       }
        g_free(trie);
 }
 
@@ -526,8 +520,6 @@ vte_trie_matchx(struct vte_trie *trie, const gunichar *pattern, size_t length,
        unsigned int i;
        const char *hres;
        enum cclass cc;
-       ssize_t partial;
-       struct trie_path *path;
        const char *best = NULL;
        GValueArray *bestarray = NULL;
        GQuark bestquark = 0;
@@ -560,37 +552,6 @@ vte_trie_matchx(struct vte_trie *trie, const gunichar *pattern, size_t length,
                }
        }
 
-       /* Try the precomputed table. */
-       if ((trie->table != NULL) &&
-           (pattern[0] < G_N_ELEMENTS(trie->table->paths))) {
-               if (trie->table->paths[pattern[0]] != NULL) {
-                       path = trie->table->paths[pattern[0]];
-                       if (path->cclass->multiple) {
-                               for (partial = 0; partial < length; partial++) {
-                                       if (trie->table->paths[pattern[partial]] != path) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               partial = 1;
-                       }
-                       if (partial > 0) {
-                               path->cclass->extract(pattern,
-                                                     partial,
-                                                     &path->data,
-                                                     array);
-                               return vte_trie_matchx(path->trie,
-                                                      pattern + partial,
-                                                      length - partial,
-                                                      FALSE,
-                                                      res,
-                                                      consumed,
-                                                      quark,
-                                                      array);
-                       }
-               }
-       }
-
        /* Now figure out which (if any) subtrees to search.  First, see
         * which character class this character matches. */
        for (cc = exact; cc < invalid; cc++)
@@ -695,52 +656,6 @@ vte_trie_matchx(struct vte_trie *trie, const gunichar *pattern, size_t length,
        return *res;
 }
 
-/* Attempt to precompute all of the paths we might take when passing this
- * node, and use that information to fill in a table. */
-TRIE_MAYBE_STATIC void
-vte_trie_precompute(struct vte_trie *trie)
-{
-       struct vte_trie_table *table;
-       enum cclass cc;
-       int i;
-       gunichar c;
-
-       /* Free the precomputed table (if there is one). */
-       if (trie->table != NULL) {
-               g_free(trie->table);
-               trie->table = NULL;
-       }
-
-       /* If there are no child nodes, then there's nothing for us to do. */
-       if (trie->trie_path_count == 0) {
-               return;
-       }
-
-       /* Create a new table and clear it. */
-       table = trie->table = g_malloc(sizeof(*table));
-       for (c = 0; c < G_N_ELEMENTS(trie->table->paths); c++) {
-               trie->table->paths[c] = NULL;
-       }
-
-       /* Decide which path a given character would cause us to take, and
-        * store it at a fixed offset in the table. */
-       for (cc = exact; cc < invalid; cc++)
-       for (i = 0; i < trie->trie_path_count; i++) {
-               struct char_class *cclass = trie->trie_paths[i].cclass;
-               if (cclass->type == cc)
-               for (c = 0; c < G_N_ELEMENTS(trie->table->paths); c++)
-               if (trie->table->paths[c] == NULL)
-               if (cclass->check(c, &trie->trie_paths[i].data)) {
-                       trie->table->paths[c] = &trie->trie_paths[i];
-               }
-       }
-
-       /* Precompute the node's children. */
-       for (i = 0; i < trie->trie_path_count; i++) {
-               vte_trie_precompute(trie->trie_paths[i].trie);
-       }
-}
-
 /* Check if the given pattern matches part of the given trie, returning an
  * empty string on a partial initial match, a NULL if there's no match in the
  * works, and the result string if we have an exact match. */
@@ -878,121 +793,16 @@ vte_trie_print(struct vte_trie *trie)
        printf("Trie has %ld nodes.\n", (long) nodecount);
 }
 
-#define SAMPLE "ABCDEF"
-static char *
-vte_trie_find_valid_encoding(char **list, size_t length, gboolean wide)
-{
-       gunichar wbuffer[8];
-       unsigned char nbuffer[8];
-       void *buffer;
-       char inbuf[BUFSIZ];
-       char outbuf[BUFSIZ];
-       char *ibuf, *obuf;
-       gsize isize, osize;
-       int i;
-       gsize outbytes;
-       GIConv conv;
-
-       if (wide) {
-               buffer = wbuffer;
-       } else {
-               buffer = nbuffer;
-       }
-
-       for (i = 0; SAMPLE[i] != '\0'; i++) {
-               wbuffer[i] = nbuffer[i] = SAMPLE[i];
-       }
-       wbuffer[i] = nbuffer[i] = SAMPLE[i];
-
-       for (i = 0; i < length; i++) {
-               conv = g_iconv_open(list[i], "UTF-8");
-               if (conv == ((GIConv) -1)) {
-#ifdef VTE_DEBUG
-                       if (vte_debug_on(VTE_DEBUG_MISC)) {
-                               fprintf(stderr, "Conversions to `%s' are not "
-                                       "supported by giconv.\n", list[i]);
-                       }
-#endif
-                       continue;
-               }
-
-               ibuf = (char*) &inbuf;
-               strcpy(inbuf, SAMPLE);
-               isize = 3;
-               obuf = (char*) &outbuf;
-               osize = sizeof(outbuf);
-
-               g_iconv(conv, &ibuf, &isize, &obuf, &osize);
-               g_iconv_close(conv);
-
-               outbytes = sizeof(outbuf) - osize;
-               if ((isize == 0) && (outbytes > 0)) {
-                       if (memcmp(outbuf, buffer, outbytes) == 0) {
-#ifdef VTE_DEBUG
-                               if (vte_debug_on(VTE_DEBUG_MISC)) {
-                                       fprintf(stderr, "Found iconv target "
-                                               "`%s'.\n", list[i]);
-                               }
-#endif
-                               return g_strdup(list[i]);
-                       }
-               }
-       }
-
-       return NULL;
-}
-
 TRIE_MAYBE_STATIC const char *
 vte_trie_wide_encoding()
 {
-       char *wide[] = {
-               "10646",
-               "ISO_10646",
-               "ISO-10646",
-               "ISO10646",
-               "ISO-10646-1",
-               "ISO10646-1",
-               "ISO-10646/UCS4",
-               "UCS-4",
-               "UCS4",
-               "UCS-4-BE",
-               "UCS-4BE",
-               "UCS4-BE",
-               "UCS-4-INTERNAL",
-               "UCS-4-LE",
-               "UCS-4LE",
-               "UCS4-LE",
-               "UNICODE",
-               "UNICODE-BIG",
-               "UNICODEBIG",
-               "UNICODE-LITTLE",
-               "UNICODELITTLE",
-               "WCHAR_T",
-       };
-       static char *ret = NULL;
-       if (ret == NULL) {
-               ret = vte_trie_find_valid_encoding(wide,
-                                                  G_N_ELEMENTS(wide),
-                                                  TRUE);
-       }
-       return ret;
+       return vte_table_wide_encoding();
 }
 
 TRIE_MAYBE_STATIC const char *
 vte_trie_narrow_encoding()
 {
-       char *narrow[] = {
-               "8859-1",
-               "ISO-8859-1",
-               "ISO8859-1",
-       };
-       static char *ret = NULL;
-       if (ret == NULL) {
-               ret = vte_trie_find_valid_encoding(narrow,
-                                                  G_N_ELEMENTS(narrow),
-                                                  FALSE);
-       }
-       return ret;
+       return vte_table_narrow_encoding();
 }
 
 #ifdef TRIE_MAIN
@@ -1077,11 +887,6 @@ main(int argc, char **argv)
                     g_quark_from_string("greedy"));
        vte_trie_add(trie, "<esc>]2;%sh", 11, "decset-title",
                     g_quark_from_string("decset-title"));
-       if (argc > 1) {
-               if (strcmp(argv[1], "--precompute") == 0) {
-                       vte_trie_precompute(trie);
-               }
-       }
 
        printf("Wide encoding is `%s'.\n", vte_trie_wide_encoding());
        printf("Narrow encoding is `%s'.\n", vte_trie_narrow_encoding());
index a5da306..300c25a 100644 (file)
@@ -57,9 +57,6 @@ const char *vte_trie_match(struct vte_trie *trie,
 /* Print the contents of the trie (mainly for diagnostic purposes). */
 void vte_trie_print(struct vte_trie *trie);
 
-/* Precompute internal information to hopefully make traversal faster. */
-void vte_trie_precompute(struct vte_trie *trie);
-
 /* A gunichar-compatible giconv target, if one can be found. */
 const char *vte_trie_wide_encoding(void);
 
index 0b69aed..b69ed54 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "trie.h"
+#include "table.h"
 #define ESC "\e"
 
 int
@@ -41,8 +41,8 @@ main(int argc, char **argv)
                return 1;
        }
 
-       conv = g_iconv_open("UTF-8", vte_trie_wide_encoding());
-       if (conv == ((GIConv*) -1)) {
+       conv = g_iconv_open("UTF-8", vte_table_wide_encoding());
+       if (conv == ((GIConv) -1)) {
                return 1;
        }
 
index bd4890c..a462f06 100644 (file)
--- a/src/vte.c
+++ b/src/vte.c
@@ -51,7 +51,7 @@
 #include "reaper.h"
 #include "ring.h"
 #include "termcap.h"
-#include "trie.h"
+#include "table.h"
 #include "vte.h"
 #include "vteaccess.h"
 #include <X11/Xlib.h>
 #include <locale.h>
 #endif
 
+#ifndef HAVE_WINT_T
+typedef long wint_t;
+#endif
+
 #ifdef ENABLE_NLS
 #include <libintl.h>
 #define _(String) dgettext(PACKAGE, String)
                                        "0123456789./+@"
 #define VTE_DEFAULT_FONT               "mono 12"
 
+#define VTE_INPUT_PRIORITY             G_PRIORITY_DEFAULT
+#define VTE_FX_PRIORITY                        G_PRIORITY_DEFAULT_IDLE
+#define VTE_ITERATION_TUNABLE          512
+
 /* The structure we use to hold characters we're supposed to display -- this
  * includes any supported visible attributes. */
 struct vte_charcell {
@@ -133,7 +141,7 @@ typedef struct _VteWordCharRange {
 struct _VteTerminalPrivate {
        /* Emulation setup data. */
        struct vte_termcap *termcap;    /* termcap storage */
-       struct vte_trie *trie;          /* control sequence trie */
+       struct vte_table *table;                /* control sequence table */
        const char *termcap_path;       /* path to termcap file */
        const char *emulation;          /* terminal type to emulate */
        GTree *sequences;               /* sequence handlers, keyed by GQuark
@@ -193,6 +201,8 @@ struct _VteTerminalPrivate {
                struct vte_charcell defaults;   /* default characteristics
                                                   for insertion of any new
                                                   characters */
+               gboolean status_line;
+               GString *status_line_contents;
        } normal_screen, alternate_screen, *screen;
 
        /* Selection information. */
@@ -319,6 +329,10 @@ static void vte_sequence_handler_do(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
                                    GValueArray *params);
+static void vte_sequence_handler_DO(VteTerminal *terminal,
+                                   const char *match,
+                                   GQuark match_quark,
+                                   GValueArray *params);
 static void vte_sequence_handler_ho(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
@@ -327,6 +341,10 @@ static void vte_sequence_handler_le(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
                                    GValueArray *params);
+static void vte_sequence_handler_LE(VteTerminal *terminal,
+                                   const char *match,
+                                   GQuark match_quark,
+                                   GValueArray *params);
 static void vte_sequence_handler_nd(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
@@ -339,6 +357,10 @@ static void vte_sequence_handler_up(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
                                    GValueArray *params);
+static void vte_sequence_handler_UP(VteTerminal *terminal,
+                                   const char *match,
+                                   GQuark match_quark,
+                                   GValueArray *params);
 static void vte_sequence_handler_us(VteTerminal *terminal,
                                    const char *match,
                                    GQuark match_quark,
@@ -831,6 +853,18 @@ vte_terminal_emit_move_window(VteTerminal *terminal, guint x, guint y)
        g_signal_emit_by_name(terminal, "move-window", x, y);
 }
 
+/* Emit a "status-line-changed" signal. */
+static void
+vte_terminal_emit_status_line_changed(VteTerminal *terminal)
+{
+#ifdef VTE_DEBUG
+       if (vte_debug_on(VTE_DEBUG_SIGNALS)) {
+               fprintf(stderr, "Emitting `status-line-changed'.\n");
+       }
+#endif
+       g_signal_emit_by_name(terminal, "status-line-changed");
+}
+
 /* Deselect anything which is selected and refresh the screen if needed. */
 static void
 vte_terminal_deselect_all(VteTerminal *terminal)
@@ -892,14 +926,20 @@ vte_terminal_get_tabstop(VteTerminal *terminal, int column)
 static void
 vte_terminal_set_default_tabstops(VteTerminal *terminal)
 {
-       int i;
+       int i, width;
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
        if (terminal->pvt->tabstops != NULL) {
                g_hash_table_destroy(terminal->pvt->tabstops);
        }
        terminal->pvt->tabstops = g_hash_table_new(g_direct_hash,
                                                   g_direct_equal);
-       for (i = 0; i <= VTE_TAB_MAX; i += VTE_TAB_WIDTH) {
+       width = vte_termcap_find_numeric(terminal->pvt->termcap,
+                                        terminal->pvt->emulation,
+                                        "it");
+       if (width == 0) {
+               width = VTE_TAB_WIDTH;
+       }
+       for (i = 0; i <= VTE_TAB_MAX; i += width) {
                vte_terminal_set_tabstop(terminal, i);
        }
 }
@@ -1338,19 +1378,19 @@ vte_terminal_set_encoding(VteTerminal *terminal, const char *codeset)
        }
 
        /* Open new conversions. */
-       new_iconv = g_iconv_open(vte_trie_wide_encoding(), codeset);
+       new_iconv = g_iconv_open(vte_table_wide_encoding(), codeset);
        if (new_iconv == ((GIConv) -1)) {
                g_warning(_("Unable to convert characters from %s to %s."),
-                         codeset, vte_trie_wide_encoding());
+                         codeset, vte_table_wide_encoding());
                if (terminal->pvt->encoding != NULL) {
                        /* Keep the current encoding. */
                        return;
                }
        }
-       new_oconvw = g_iconv_open(codeset, vte_trie_wide_encoding());
+       new_oconvw = g_iconv_open(codeset, vte_table_wide_encoding());
        if (new_oconvw == ((GIConv) -1)) {
                g_warning(_("Unable to convert characters from %s to %s."),
-                         vte_trie_wide_encoding(), codeset);
+                         vte_table_wide_encoding(), codeset);
                g_iconv_close(new_iconv);
                if (terminal->pvt->encoding != NULL) {
                        /* Keep the current encoding. */
@@ -1370,16 +1410,16 @@ vte_terminal_set_encoding(VteTerminal *terminal, const char *codeset)
        }
 
        if (new_oconvu == ((GIConv) -1)) {
-               codeset = vte_trie_narrow_encoding();
-               new_iconv = g_iconv_open(vte_trie_wide_encoding(), codeset);
+               codeset = vte_table_narrow_encoding();
+               new_iconv = g_iconv_open(vte_table_wide_encoding(), codeset);
                if (new_iconv == ((GIConv) -1)) {
                        g_error(_("Unable to convert characters from %s to %s."),
-                               codeset, vte_trie_wide_encoding());
+                               codeset, vte_table_wide_encoding());
                }
-               new_oconvw = g_iconv_open(codeset, vte_trie_wide_encoding());
+               new_oconvw = g_iconv_open(codeset, vte_table_wide_encoding());
                if (new_oconvw == ((GIConv) -1)) {
                        g_error(_("Unable to convert characters from %s to %s."),
-                               vte_trie_wide_encoding(), codeset);
+                               vte_table_wide_encoding(), codeset);
                }
                new_oconvu = g_iconv_open(codeset, "UTF-8");
                if (new_oconvu == ((GIConv) -1)) {
@@ -1884,6 +1924,46 @@ vte_sequence_handler_ct(VteTerminal *terminal,
        }
 }
 
+/* Move the cursor to the lower left-hand corner. */
+static void
+vte_sequence_handler_cursor_lower_left(VteTerminal *terminal,
+                                      const char *match,
+                                      GQuark match_quark,
+                                      GValueArray *params)
+{
+       VteScreen *screen;
+       g_return_if_fail(VTE_IS_TERMINAL(terminal));
+       screen = terminal->pvt->screen;
+       screen->cursor_current.row = screen->insert_delta +
+                                    terminal->row_count - 1;
+       screen->cursor_current.col = 0;
+       vte_terminal_ensure_cursor(terminal, TRUE);
+}
+
+/* Move the cursor to the beginning of the next line, scrolling if necessary. */
+static void
+vte_sequence_handler_cursor_next_line(VteTerminal *terminal,
+                                     const char *match,
+                                     GQuark match_quark,
+                                     GValueArray *params)
+{
+       g_return_if_fail(VTE_IS_TERMINAL(terminal));
+       terminal->pvt->screen->cursor_current.col = 0;
+       vte_sequence_handler_DO(terminal, match, match_quark, params);
+}
+
+/* Move the cursor to the beginning of the next line, scrolling if necessary. */
+static void
+vte_sequence_handler_cursor_preceding_line(VteTerminal *terminal,
+                                          const char *match,
+                                          GQuark match_quark,
+                                          GValueArray *params)
+{
+       g_return_if_fail(VTE_IS_TERMINAL(terminal));
+       terminal->pvt->screen->cursor_current.col = 0;
+       vte_sequence_handler_UP(terminal, match, match_quark, params);
+}
+
 /* Move the cursor to the given row (vertical position). */
 static void
 vte_sequence_handler_cv(VteTerminal *terminal,
@@ -2211,6 +2291,17 @@ vte_sequence_handler_ei(VteTerminal *terminal,
        terminal->pvt->screen->insert_mode = FALSE;
 }
 
+/* Move from status line. */
+static void
+vte_sequence_handler_fs(VteTerminal *terminal,
+                       const char *match,
+                       GQuark match_quark,
+                       GValueArray *params)
+{
+       g_return_if_fail(VTE_IS_TERMINAL(terminal));
+       terminal->pvt->screen->status_line = FALSE;
+}
+
 /* Move the cursor to the home position. */
 static void
 vte_sequence_handler_ho(VteTerminal *terminal,
@@ -2225,6 +2316,17 @@ vte_sequence_handler_ho(VteTerminal *terminal,
        screen->cursor_current.col = 0;
 }
 
+/* Move the cursor to a specified position. */
+static void
+vte_sequence_handler_horizontal_and_vertical_position(VteTerminal *terminal,
+                                                     const char *match,
+                                                     GQuark match_quark,
+                                                     GValueArray *params)
+{
+       vte_sequence_handler_offset(terminal, match, match_quark, params,
+                                   -1, vte_sequence_handler_cm);
+}
+
 /* Insert a character. */
 static void
 vte_sequence_handler_ic(VteTerminal *terminal,
@@ -2468,6 +2570,16 @@ vte_sequence_handler_noop(VteTerminal *terminal,
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
 }
 
+/* Carriage return command(?). */
+static void
+vte_sequence_handler_nw(VteTerminal *terminal,
+                       const char *match,
+                       GQuark match_quark,
+                       GValueArray *params)
+{
+       vte_sequence_handler_cr(terminal, match, match_quark, params);
+}
+
 /* Restore cursor (position). */
 static void
 vte_sequence_handler_rc(VteTerminal *terminal,
@@ -2745,7 +2857,7 @@ vte_sequence_handler_tab_clear(VteTerminal *terminal,
        }
 }
 
-/* Terminal usage starts. */
+/* Move to status line. */
 static void
 vte_sequence_handler_ts(VteTerminal *terminal,
                        const char *match,
@@ -2753,7 +2865,9 @@ vte_sequence_handler_ts(VteTerminal *terminal,
                        GValueArray *params)
 {
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
-       /* I think this is a no-op. */
+       terminal->pvt->screen->status_line = TRUE;
+       g_string_truncate(terminal->pvt->screen->status_line_contents, 0);
+       vte_terminal_emit_status_line_changed(terminal);
 }
 
 /* Underline this character and move right. */
@@ -3165,7 +3279,7 @@ vte_sequence_handler_set_title_int(VteTerminal *terminal,
                if (G_VALUE_HOLDS_POINTER(value)) {
                        /* Convert the unicode-character string into a
                         * multibyte string. */
-                       conv = g_iconv_open("UTF-8", vte_trie_wide_encoding());
+                       conv = g_iconv_open("UTF-8", vte_table_wide_encoding());
                        inbuf = g_value_get_pointer(value);
                        inbuf_len = vte_unicode_strlen((gunichar*)inbuf) *
                                    sizeof(gunichar);
@@ -3656,6 +3770,16 @@ vte_sequence_handler_decreset(VteTerminal *terminal,
        }
 }
 
+/* Erase a specified number of characters. */
+static void
+vte_sequence_handler_erase_characters(VteTerminal *terminal,
+                                     const char *match,
+                                     GQuark match_quark,
+                                     GValueArray *params)
+{
+       vte_sequence_handler_ec(terminal, match, match_quark, params);
+}
+
 /* Erase certain lines in the display. */
 static void
 vte_sequence_handler_erase_in_display(VteTerminal *terminal,
@@ -3751,6 +3875,16 @@ vte_sequence_handler_full_reset(VteTerminal *terminal,
        vte_terminal_reset(terminal, TRUE, TRUE);
 }
 
+/* Insert a specified number of blank characters. */
+static void
+vte_sequence_handler_insert_blank_characters(VteTerminal *terminal,
+                                            const char *match,
+                                            GQuark match_quark,
+                                            GValueArray *params)
+{
+       vte_sequence_handler_IC(terminal, match, match_quark, params);
+}
+
 /* Insert a certain number of lines below the current cursor. */
 static void
 vte_sequence_handler_insert_lines(VteTerminal *terminal,
@@ -3862,10 +3996,10 @@ vte_sequence_handler_local_charset(VteTerminal *terminal,
 {
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
 #ifdef VTE_DEFAULT_ISO_8859_1
-       vte_terminal_set_encoding(terminal, vte_trie_narrow_encoding());
+       vte_terminal_set_encoding(terminal, vte_table_narrow_encoding());
 #else
        if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
-               vte_terminal_set_encoding(terminal, vte_trie_narrow_encoding());
+               vte_terminal_set_encoding(terminal, vte_table_narrow_encoding());
        } else {
                vte_terminal_set_encoding(terminal, nl_langinfo(CODESET));
        }
@@ -4358,7 +4492,7 @@ vte_sequence_handler_designate_gx(VteTerminal *terminal,
                                case '7':
                                case '=':       /* Swiss. */
                                        terminal->pvt->gxencoding[x] =
-                                               vte_trie_narrow_encoding();
+                                               vte_table_narrow_encoding();
                                        break;
                        }
                }
@@ -4521,7 +4655,7 @@ static struct {
        {"ei", vte_sequence_handler_ei},
 
        {"ff", vte_sequence_handler_noop},
-       {"fs", NULL},
+       {"fs", vte_sequence_handler_fs},
        {"F1", vte_sequence_handler_complain_key},
        {"F2", vte_sequence_handler_complain_key},
        {"F3", vte_sequence_handler_complain_key},
@@ -4667,7 +4801,7 @@ static struct {
        {"MR", NULL},
 
        {"nd", vte_sequence_handler_nd},
-       {"nw", NULL},
+       {"nw", vte_sequence_handler_nw},
 
        {"pc", NULL},
        {"pf", NULL},
@@ -4748,15 +4882,15 @@ static struct {
        {"character-attributes", vte_sequence_handler_character_attributes},
        {"character-position-absolute", vte_sequence_handler_character_position_absolute},
        {"cursor-back-tab", vte_sequence_handler_bt},
-       {"cursor-backward", vte_sequence_handler_le},
+       {"cursor-backward", vte_sequence_handler_LE},
        {"cursor-character-absolute", vte_sequence_handler_cursor_character_absolute},
        {"cursor-down", vte_sequence_handler_DO},
        {"cursor-forward-tabulation", vte_sequence_handler_ta},
        {"cursor-forward", vte_sequence_handler_RI},
-       {"cursor-lower-left", NULL},
-       {"cursor-next-line", NULL},
+       {"cursor-lower-left", vte_sequence_handler_cursor_lower_left},
+       {"cursor-next-line", vte_sequence_handler_cursor_next_line},
        {"cursor-position", vte_sequence_handler_cursor_position},
-       {"cursor-preceding-line", NULL},
+       {"cursor-preceding-line", vte_sequence_handler_cursor_preceding_line},
        {"cursor-up", vte_sequence_handler_UP},
        {"dec-device-status-report", vte_sequence_handler_dec_device_status_report},
        {"dec-media-copy", NULL},
@@ -4776,14 +4910,14 @@ static struct {
        {"enable-filter-rectangle", NULL},
        {"enable-locator-reporting", NULL},
        {"end-of-guarded-area", NULL},
-       {"erase-characters", NULL},
+       {"erase-characters", vte_sequence_handler_erase_characters},
        {"erase-in-display", vte_sequence_handler_erase_in_display},
        {"erase-in-line", vte_sequence_handler_erase_in_line},
        {"full-reset", vte_sequence_handler_full_reset},
-       {"horizontal-and-vertical-position", NULL},
+       {"horizontal-and-vertical-position", vte_sequence_handler_horizontal_and_vertical_position},
        {"index", vte_sequence_handler_index},
        {"initiate-hilite-mouse-tracking", NULL},
-       {"insert-blank-characters", NULL},
+       {"insert-blank-characters", vte_sequence_handler_insert_blank_characters},
        {"insert-lines", vte_sequence_handler_insert_lines},
        {"invoke-g1-character-set-as-gr", NULL},
        {"invoke-g2-character-set-as-gr", NULL},
@@ -5133,6 +5267,13 @@ vte_terminal_insert_char(GtkWidget *widget, gunichar c, gboolean force_insert)
                        (long)screen->insert_delta);
        }
 #endif
+       /* If this character is destined for the status line, save it. */
+       if (terminal->pvt->screen->status_line) {
+               g_string_append_unichar(terminal->pvt->screen->status_line_contents,
+                                       c);
+               vte_terminal_emit_status_line_changed(terminal);
+               return;
+       }
 
        /* Figure out how many columns this character should occupy. */
        columns = vte_unichar_width(c);
@@ -5430,7 +5571,7 @@ vte_terminal_fork_command(VteTerminal *terminal, const char *command,
                        g_io_channel_unix_new(terminal->pvt->pty_master);
                terminal->pvt->pty_input_source =
                        g_io_add_watch_full(terminal->pvt->pty_input,
-                                           G_PRIORITY_LOW,
+                                           G_PRIORITY_DEFAULT,
                                            G_IO_IN | G_IO_HUP,
                                            vte_terminal_io_read,
                                            terminal,
@@ -5516,6 +5657,7 @@ vte_terminal_process_incoming(gpointer data)
        size_t icount, ocount, ucount;
        gunichar *wbuf, c;
        int wcount, start;
+       long iterations = 0;
        const char *match, *encoding;
        GIConv unconv;
        GQuark quark;
@@ -5596,118 +5738,14 @@ vte_terminal_process_incoming(gpointer data)
        start = 0;
        modified = leftovers = FALSE;
        while ((start < wcount) && !leftovers) {
-               /* Check if the first character is part of a control
-                * sequence. */
-               vte_trie_match(terminal->pvt->trie,
-                              &wbuf[start],
-                              1,
-                              &match,
-                              &next,
-                              &quark,
-                              &params);
-               /* Next now points to the next character in the buffer we're
-                * uncertain about.  The match string falls into one of three
-                * classes, but only one of them is ambiguous, and we want to
-                * clear that up if possible. */
-               if ((match != NULL) && (match[0] == '\0')) {
-#ifdef VTE_DEBUG
-                       if (vte_debug_on(VTE_DEBUG_PARSE)) {
-                               fprintf(stderr, "Ambiguous sequence  at %d of %d.  "
-                                       "Resolving.\n", start, wcount);
-                       }
-#endif
-                       /* Try to match the *entire* string.  This will set
-                        * "next" to a more useful value. */
-                       free_params_array(params);
-                       params = NULL;
-                       vte_trie_match(terminal->pvt->trie,
-                                      &wbuf[start],
-                                      wcount - start,
-                                      &match,
-                                      &next,
-                                      &quark,
-                                      &params);
-                       /* Now check just the number of bytes we know about
-                        * to determine what we're doing in this iteration. */
-                       if (match == NULL) {
-#ifdef VTE_DEBUG
-                               if (vte_debug_on(VTE_DEBUG_PARSE)) {
-                                       fprintf(stderr,
-                                               "Looks like a sequence at %d, "
-                                               "length = %d.\n", start,
-                                               next - (wbuf + start));
-                               }
-#endif
-                               free_params_array(params);
-                               params = NULL;
-                               vte_trie_match(terminal->pvt->trie,
-                                              &wbuf[start],
-                                              next - (wbuf + start),
-                                              &match,
-                                              &next,
-                                              &quark,
-                                              &params);
-                       }
-#ifdef VTE_DEBUG
-                       if (vte_debug_on(VTE_DEBUG_PARSE)) {
-                               if ((match != NULL) && (match[0] != '\0')) {
-                                       fprintf(stderr,
-                                               "Ambiguity resolved -- sequence at %d, "
-                                               "length = %d.\n", start,
-                                               next - (wbuf + start));
-                               }
-                               if ((match != NULL) && (match[0] == '\0')) {
-                                       int i;
-                                       fprintf(stderr,
-                                               "Ambiguity resolved -- incomplete `");
-                                       for (i = 0; i < wcount; i++) {
-                                               if (i == start) {
-                                                       fprintf(stderr, "=>");
-                                               } else
-                                               if (i == (next - wbuf)) {
-                                                       fprintf(stderr, "<=");
-                                               }
-                                               if ((wbuf[i] < 32) || (wbuf[i] > 127)) {
-                                                       fprintf(stderr, "{%ld}",
-                                                               (long) wbuf[i]);
-                                               } else {
-                                                       fprintf(stderr, "%lc",
-                                                               (wint_t) wbuf[i]);
-                                               }
-                                       }
-                                       if (i == (next - wbuf)) {
-                                               fprintf(stderr, "<=");
-                                       }
-                                       fprintf(stderr, "' at %d.\n", start);
-                               }
-                               if (match == NULL) {
-                                       fprintf(stderr, "Ambiguity resolved -- "
-                                               "plain data (%d).\n", start);
-                               }
-                       }
-#endif
-               }
-
-#ifdef VTE_DEBUG
-               else {
-                       if (vte_debug_on(VTE_DEBUG_PARSE)) {
-                               if ((match != NULL) && (match[0] != '\0')) {
-                                       fprintf(stderr,
-                                               "Sequence (%d).\n", next - wbuf);
-                               }
-                               if ((match != NULL) && (match[0] == '\0')) {
-                                       fprintf(stderr,
-                                               "Incomplete (%d).\n", next - wbuf);
-                               }
-                               if (match == NULL) {
-                                       if (vte_debug_on(VTE_DEBUG_MISC)) {
-                                               fprintf(stderr,
-                                                       "Plain data (%d).\n", next - wbuf);
-                                       }
-                               }
-                       }
-               }
-#endif
+               /* Try to match any control sequences. */
+               vte_table_match(terminal->pvt->table,
+                               &wbuf[start],
+                               wcount - start,
+                               &match,
+                               &next,
+                               &quark,
+                               &params);
                /* We're in one of three possible situations now.
                 * First, the match string is a non-empty string and next
                 * points to the first character which isn't part of this
@@ -5776,6 +5814,13 @@ vte_terminal_process_incoming(gpointer data)
                                leftovers = TRUE;
                        }
                }
+               /* Process updates if we've processed enough characters.  This
+                * keeps the user from thinking we've hung if we're processing
+                * a *lot* of data. */
+               if ((start / VTE_ITERATION_TUNABLE) != iterations) {
+                       iterations = start / VTE_ITERATION_TUNABLE;
+                       gdk_window_process_updates(widget->window, TRUE);
+               }
                /* Free any parameters we don't care about any more. */
                free_params_array(params);
                params = NULL;
@@ -5784,7 +5829,7 @@ vte_terminal_process_incoming(gpointer data)
        if (leftovers) {
                /* There are leftovers, so convert them back to the terminal's
                 * old encoding and save them for later. */
-               unconv = g_iconv_open(encoding, vte_trie_wide_encoding());
+               unconv = g_iconv_open(encoding, vte_table_wide_encoding());
                if (unconv != ((GIConv) -1)) {
                        icount = sizeof(gunichar) * (wcount - start);
                        ibuf = (char*) &wbuf[start];
@@ -5989,7 +6034,7 @@ vte_terminal_io_read(GIOChannel *channel,
 #endif
                terminal->pvt->processing = TRUE;
                terminal->pvt->processing_tag =
-                               g_idle_add_full(G_PRIORITY_HIGH,
+                               g_idle_add_full(VTE_INPUT_PRIORITY,
                                                vte_terminal_process_incoming,
                                                terminal,
                                                NULL);
@@ -6040,7 +6085,7 @@ vte_terminal_feed(VteTerminal *terminal, const char *data, size_t length)
 #endif
                terminal->pvt->processing = TRUE;
                terminal->pvt->processing_tag =
-                               g_idle_add_full(G_PRIORITY_HIGH,
+                               g_idle_add_full(VTE_INPUT_PRIORITY,
                                                vte_terminal_process_incoming,
                                                terminal,
                                                NULL);
@@ -6109,13 +6154,13 @@ vte_terminal_send(VteTerminal *terminal, const char *encoding,
 
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
        g_assert((strcmp(encoding, "UTF-8") == 0) ||
-                (strcmp(encoding, vte_trie_wide_encoding()) == 0));
+                (strcmp(encoding, vte_table_wide_encoding()) == 0));
 
        conv = NULL;
        if (strcmp(encoding, "UTF-8") == 0) {
                conv = &terminal->pvt->outgoing_conv_utf8;
        }
-       if (strcmp(encoding, vte_trie_wide_encoding()) == 0) {
+       if (strcmp(encoding, vte_table_wide_encoding()) == 0) {
                conv = &terminal->pvt->outgoing_conv_wide;
        }
        g_assert(conv != NULL);
@@ -8714,11 +8759,11 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
        /* Find and read the right termcap file. */
        vte_terminal_set_termcap(terminal, NULL, FALSE);
 
-       /* Create a trie to hold the control sequences. */
-       if (terminal->pvt->trie) {
-               vte_trie_free(terminal->pvt->trie);
+       /* Create a table to hold the control sequences. */
+       if (terminal->pvt->table) {
+               vte_table_free(terminal->pvt->table);
        }
-       terminal->pvt->trie = vte_trie_new();
+       terminal->pvt->table = vte_table_new();
 
        /* Create a tree to hold the handlers. */
        if (terminal->pvt->sequences) {
@@ -8735,25 +8780,31 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
        }
 
        /* Load the known capability strings from the termcap structure into
-        * the trie for recognition. */
+        * the table for recognition. */
        for (i = 0;
             vte_terminal_capability_strings[i].capability != NULL;
             i++) {
+               if (vte_terminal_capability_strings[i].key) {
+                       continue;
+               }
                code = vte_terminal_capability_strings[i].capability;
                tmp = vte_termcap_find_string(terminal->pvt->termcap,
                                              terminal->pvt->emulation,
                                              code);
                if ((tmp != NULL) && (tmp[0] != '\0')) {
                        vte_termcap_strip(tmp, &stripped, &stripped_length);
-                       vte_trie_add(terminal->pvt->trie,
-                                    stripped, stripped_length,
-                                    code,
-                                    0);
+                       vte_table_add(terminal->pvt->table,
+                                     stripped, stripped_length,
+                                     code,
+                                     0);
                        if (stripped[0] == '\r') {
                                found_cr = TRUE;
                        } else
                        if (stripped[0] == '\n') {
-                               found_lf = TRUE;
+                               if ((strcmp(code, "sf") == 0) ||
+                                   (strcmp(code, "do") == 0)) {
+                                       found_lf = TRUE;
+                               }
                        }
                        g_free(stripped);
                }
@@ -8769,43 +8820,25 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
                        code = vte_xterm_capability_strings[i].code;
                        value = vte_xterm_capability_strings[i].value;
                        vte_termcap_strip(code, &stripped, &stripped_length);
-                       vte_trie_add(terminal->pvt->trie,
+                       vte_table_add(terminal->pvt->table,
                                     stripped, stripped_length,
                                     value, 0);
                        g_free(stripped);
                }
-#if 0
-       } else {
-               /* Add at least ANSI color, which everyone wants. */
-               for (i = 0;
-                    vte_xterm_capability_strings[i].value != NULL;
-                    i++) {
-                       code = vte_xterm_capability_strings[i].code;
-                       value = vte_xterm_capability_strings[i].value;
-                       if (strcmp(code, "character-attributes") == 0) {
-                               vte_termcap_strip(code,
-                                                 &stripped, &stripped_length);
-                               vte_trie_add(terminal->pvt->trie,
-                                            stripped, stripped_length,
-                                            value, 0);
-                               g_free(stripped);
-                       }
-               }
-#endif
        }
 
        /* Always define cr and lf. */
        if (!found_cr) {
-               vte_trie_add(terminal->pvt->trie, "\r", 1, "cr", 0);
+               vte_table_add(terminal->pvt->table, "\r", 1, "cr", 0);
        }
        if (!found_lf) {
-               vte_trie_add(terminal->pvt->trie, "\n", 1, "sf", 0);
+               vte_table_add(terminal->pvt->table, "\n", 1, "sf", 0);
        }
 
 #ifdef VTE_DEBUG
        if (vte_debug_on(VTE_DEBUG_MISC)) {
                fprintf(stderr, "Trie contents:\n");
-               vte_trie_print(terminal->pvt->trie);
+               vte_table_print(terminal->pvt->table);
                fprintf(stderr, "\n");
        }
 #endif
@@ -8960,7 +8993,7 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
 
        /* Load the termcap data and set up the emulation. */
        pvt->termcap = NULL;
-       pvt->trie = NULL;
+       pvt->table = NULL;
        pvt->termcap_path = NULL;
        memset(&pvt->flags, 0, sizeof(pvt->flags));
        pvt->flags.am = FALSE;
@@ -9035,6 +9068,8 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
        pvt->alternate_screen.scroll_delta = 0;
        pvt->alternate_screen.insert_mode = FALSE;
        pvt->alternate_screen.reverse_mode = FALSE;
+       pvt->alternate_screen.status_line = FALSE;
+       pvt->alternate_screen.status_line_contents = g_string_new("");
        pvt->screen = &terminal->pvt->alternate_screen;
        vte_terminal_set_default_attributes(terminal);
 
@@ -9049,6 +9084,8 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
        pvt->normal_screen.scroll_delta = 0;
        pvt->normal_screen.insert_mode = FALSE;
        pvt->normal_screen.reverse_mode = FALSE;
+       pvt->normal_screen.status_line = FALSE;
+       pvt->normal_screen.status_line_contents = g_string_new("");
        pvt->screen = &terminal->pvt->normal_screen;
        vte_terminal_set_default_attributes(terminal);
 
@@ -9458,6 +9495,14 @@ vte_terminal_finalize(GObject *object)
        vte_ring_free(terminal->pvt->alternate_screen.row_data, TRUE);
        terminal->pvt->alternate_screen.row_data = NULL;
 
+       /* Clear the status lines. */
+       terminal->pvt->normal_screen.status_line = FALSE;
+       g_string_free(terminal->pvt->normal_screen.status_line_contents,
+                     TRUE);
+       terminal->pvt->alternate_screen.status_line = FALSE;
+       g_string_free(terminal->pvt->alternate_screen.status_line_contents,
+                     TRUE);
+
        /* Free conversion descriptors. */
        if (terminal->pvt->incoming_conv != ((GIConv) -1)) {
                g_iconv_close(terminal->pvt->incoming_conv);
@@ -9524,8 +9569,8 @@ vte_terminal_finalize(GObject *object)
        terminal->pvt->sequences= NULL;
        terminal->pvt->emulation = NULL;
        terminal->pvt->termcap_path = NULL;
-       vte_trie_free(terminal->pvt->trie);
-       terminal->pvt->trie = NULL;
+       vte_table_free(terminal->pvt->table);
+       terminal->pvt->table = NULL;
        vte_termcap_free(terminal->pvt->termcap);
        terminal->pvt->termcap = NULL;
 
@@ -11310,12 +11355,21 @@ vte_terminal_class_init(VteTerminalClass *klass, gconstpointer data)
                             NULL,
                             _vte_marshal_VOID__UINT_UINT,
                             G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+       klass->status_line_changed_signal =
+               g_signal_new("status-line-changed",
+                            G_OBJECT_CLASS_TYPE(klass),
+                            G_SIGNAL_RUN_LAST,
+                            0,
+                            NULL,
+                            NULL,
+                            _vte_marshal_VOID__VOID,
+                            G_TYPE_NONE, 0);
 
        /* Try to determine some acceptable encoding names. */
-       if (vte_trie_narrow_encoding() == NULL) {
+       if (vte_table_narrow_encoding() == NULL) {
                g_error("Don't know how to read ISO-8859-1 data!");
        }
-       if (vte_trie_wide_encoding() == NULL) {
+       if (vte_table_wide_encoding() == NULL) {
                g_error("Don't know how to read native-endian unicode data!");
        }
 
@@ -11675,7 +11729,7 @@ vte_terminal_update_transparent(gpointer data)
 
 /* Queue an update of the background image, to be done as soon as we can
  * get to it.  Just bail if there's already an update pending, so that if
- * opaque move tries to screw us, we don't end up with an insane backlog
+ * opaque move tables to screw us, we don't end up with an insane backlog
  * of updates after the user finishes moving us. */
 static void
 vte_terminal_queue_background_update(VteTerminal *terminal)
@@ -11684,7 +11738,7 @@ vte_terminal_queue_background_update(VteTerminal *terminal)
        if (!terminal->pvt->bg_transparent_update_pending) {
                terminal->pvt->bg_transparent_update_pending = TRUE;
                terminal->pvt->bg_transparent_update_tag =
-                               g_idle_add_full(G_PRIORITY_HIGH_IDLE,
+                               g_idle_add_full(VTE_FX_PRIORITY,
                                                vte_terminal_update_transparent,
                                                terminal,
                                                NULL);
@@ -11958,7 +12012,7 @@ vte_terminal_set_word_chars(VteTerminal *terminal, const char *spec)
        terminal->pvt->word_chars = g_array_new(FALSE, TRUE,
                                                sizeof(VteWordCharRange));
        /* Convert the spec from UTF-8 to a string of gunichars . */
-       conv = g_iconv_open(vte_trie_wide_encoding(), "UTF-8");
+       conv = g_iconv_open(vte_table_wide_encoding(), "UTF-8");
        if (conv == ((GIConv) -1)) {
                /* Aaargh.  We're screwed. */
                g_warning(_("g_iconv_open() failed setting word characters"));
@@ -12090,6 +12144,19 @@ vte_terminal_reset(VteTerminal *terminal, gboolean full, gboolean clear_history)
                terminal->pvt->alternate_screen.cursor_current.row = 0;
                terminal->pvt->alternate_screen.cursor_current.col = 0;
        }
+       /* Clear the status lines. */
+       terminal->pvt->normal_screen.status_line = FALSE;
+       if (terminal->pvt->normal_screen.status_line_contents != NULL) {
+               g_string_free(terminal->pvt->normal_screen.status_line_contents,
+                             TRUE);
+       }
+       terminal->pvt->normal_screen.status_line_contents = g_string_new("");
+       terminal->pvt->alternate_screen.status_line = FALSE;
+       if (terminal->pvt->alternate_screen.status_line_contents != NULL) {
+               g_string_free(terminal->pvt->alternate_screen.status_line_contents,
+                             TRUE);
+       }
+       terminal->pvt->alternate_screen.status_line_contents = g_string_new("");
        /* Do more stuff we refer to as a "full" reset. */
        if (full) {
                vte_terminal_set_default_tabstops(terminal);
@@ -12129,3 +12196,10 @@ vte_terminal_reset(VteTerminal *terminal, gboolean full, gboolean clear_history)
        terminal->pvt->mouse_last_x = 0;
        terminal->pvt->mouse_last_y = 0;
 }
+
+const char *
+vte_terminal_get_status_line(VteTerminal *terminal)
+{
+       g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+       return terminal->pvt->screen->status_line_contents->str;
+}
index 3844b49..ca6dddf 100644 (file)
--- a/src/vte.h
+++ b/src/vte.h
@@ -80,7 +80,7 @@ typedef struct _VteTerminalClass {
        guint resize_window_signal;
        guint move_window_signal;
 
-       gpointer reserved1;
+       guint status_line_changed_signal;
        gpointer reserved2;
        gpointer reserved3;
        gpointer reserved4;
@@ -240,6 +240,9 @@ const char *vte_terminal_get_emulation(VteTerminal *terminal);
 void vte_terminal_set_encoding(VteTerminal *terminal, const char *encoding);
 const char *vte_terminal_get_encoding(VteTerminal *terminal);
 
+/* Get the contents of the status line. */
+const char *vte_terminal_get_status_line(VteTerminal *terminal);
+
 G_END_DECLS
 
 #endif
index 5dd2d86..a70e063 100644 (file)
@@ -78,6 +78,13 @@ destroy_and_quit_exited(GtkWidget *widget, gpointer data)
        destroy_and_quit(widget, data);
 }
 
+static void
+status_line_changed(GtkWidget *widget, gpointer data)
+{
+       g_print("Status = `%s'.\n",
+               vte_terminal_get_status_line(VTE_TERMINAL(widget)));
+}
+
 int
 main(int argc, char **argv)
 {
@@ -191,6 +198,10 @@ main(int argc, char **argv)
        g_signal_connect(G_OBJECT(widget), "child-exited",
                         G_CALLBACK(destroy_and_quit_exited), widget);
 
+       /* Connect to the "status-line-changed" signal. */
+       g_signal_connect(G_OBJECT(widget), "status-line-changed",
+                        G_CALLBACK(status_line_changed), widget);
+
        /* Create the scrollbar for the widget. */
        scrollbar = gtk_vscrollbar_new((VTE_TERMINAL(widget))->adjustment);
        gtk_box_pack_start(GTK_BOX(hbox), scrollbar, FALSE, FALSE, 0);
index 60314bd..d7165e8 100644 (file)
--- a/vte.spec
+++ b/vte.spec
@@ -1,5 +1,5 @@
 Name: vte
-Version: 0.5.4
+Version: 0.6.0
 Release: 1
 Summary: An experimental terminal emulator.
 License: LGPL
@@ -58,6 +58,10 @@ make install DESTDIR=$RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Tue Jul 30 2002 Nalin Dahyabhai <nalin@redhat.com> 0.6.0-1
+- rework parsing to use tables instead of tries
+- implement more xterm-specific behaviors
+
 * Thu Jul 25 2002 Nalin Dahyabhai <nalin@redhat.com> 0.5.4-1
 - fix default PTY size bug