Problem: Libvterm code lags behind the upstream version.
Solution: Include revisions 734 - 740.
--- /dev/null
+How to Contribute
+-----------------
+
+The main resources for this library are:
+
+ Launchpad
+ https://launchpad.net/libvterm
+
+ Freenode:
+ ##tty or #tickit on irc.freenode.net
+
+ Email:
+ Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
+
+
+Bug reports and feature requests can be sent to any of the above resources.
+
+New features, bug patches, etc.. should in the first instance be discussed via
+any of the resources listed above, before starting work on the actual code.
+There may be future plans or development already in-progress that could be
+affected so it is better to discuss the ideas first before starting work
+actually writing any code.
HFILES_INT=$(sort $(wildcard src/*.h)) $(HFILES)
VERSION_MAJOR=0
-VERSION_MINOR=0
+VERSION_MINOR=1
VERSION_CURRENT=0
VERSION_REVISION=0
VERSION_AGE=0
-VERSION=0
+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
# DIST CUT
-VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
-
DISTDIR=libvterm-$(VERSION)
distdir: $(INCFILES)
mkdir __distdir
- cp LICENSE __distdir
+ cp LICENSE CONTRIBUTING __distdir
mkdir __distdir/src
cp src/*.c src/*.h src/*.inc __distdir/src
mkdir __distdir/src/encoding
123 SGR 1 = Bold on
SGR 3 = Italic on
123 SGR 4 = Underline single
+ SGR 4:x = Underline style
123 SGR 5 = Blink on
123 SGR 7 = Reverse on
SGR 9 = Strikethrough on
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
+#define VTERM_VERSION_MAJOR 0
+#define VTERM_VERSION_MINOR 1
+
+#define VTERM_CHECK_VERSION \
+ vterm_check_version(VTERM_VERSION_MAJOR, VTERM_VERSION_MINOR)
+
typedef struct VTerm VTerm;
typedef struct VTermState VTermState;
typedef struct VTermScreen VTermScreen;
void (*free)(void *ptr, void *allocdata);
} VTermAllocatorFunctions;
+void vterm_check_version(int major, int minor);
+
// Allocate and initialize a new terminal with default allocators.
VTerm *vterm_new(int rows, int cols);
unsigned int dhl : 2; // On a DECDHL line (1=top 2=bottom)
} VTermScreenCellAttrs;
+enum {
+ VTERM_UNDERLINE_OFF,
+ VTERM_UNDERLINE_SINGLE,
+ VTERM_UNDERLINE_DOUBLE,
+ VTERM_UNDERLINE_CURLY,
+};
+
typedef struct {
#define VTERM_MAX_CHARS_PER_CELL 6
uint32_t chars[VTERM_MAX_CHARS_PER_CELL];
setpenattr_bool(state, VTERM_ATTR_ITALIC, 1);
break;
- case 4: // Underline single
- state->pen.underline = 1;
- setpenattr_int(state, VTERM_ATTR_UNDERLINE, 1);
+ case 4: // Underline
+ state->pen.underline = VTERM_UNDERLINE_SINGLE;
+ if(CSI_ARG_HAS_MORE(args[argi])) {
+ argi++;
+ switch(CSI_ARG(args[argi])) {
+ case 0:
+ state->pen.underline = 0;
+ break;
+ case 1:
+ state->pen.underline = VTERM_UNDERLINE_SINGLE;
+ break;
+ case 2:
+ state->pen.underline = VTERM_UNDERLINE_DOUBLE;
+ break;
+ case 3:
+ state->pen.underline = VTERM_UNDERLINE_CURLY;
+ break;
+ }
+ }
+ setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
break;
case 5: // Blink
break;
case 21: // Underline double
- state->pen.underline = 2;
- setpenattr_int(state, VTERM_ATTR_UNDERLINE, 2);
+ state->pen.underline = VTERM_UNDERLINE_DOUBLE;
+ setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
break;
case 22: // Bold off
if(state->pen.italic)
args[argi++] = 3;
- if(state->pen.underline == 1)
+ if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
args[argi++] = 4;
+ if(state->pen.underline == VTERM_UNDERLINE_CURLY)
+ args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;
if(state->pen.blink)
args[argi++] = 5;
if(state->pen.font)
args[argi++] = 10 + state->pen.font;
- if(state->pen.underline == 2)
+ if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
args[argi++] = 21;
if(state->fg_index >= 0 && state->fg_index < 8)
(*copycell)(pos, srcpos, user);
}
}
+
+void vterm_check_version(int major, int minor)
+{
+ if(major != VTERM_VERSION_MAJOR) {
+ fprintf(stderr, "libvterm major version mismatch; %d (wants) != %d (library)\n",
+ major, VTERM_VERSION_MAJOR);
+ exit(1);
+ }
+
+ if(minor > VTERM_VERSION_MINOR) {
+ fprintf(stderr, "libvterm minor version mismatch; %d (wants) > %d (library)\n",
+ minor, VTERM_VERSION_MINOR);
+ exit(1);
+ }
+
+ // Happy
+}
?pen underline = 2
PUSH "\e[24m"
?pen underline = 0
+PUSH "\e[4m\e[4:0m"
+ ?pen underline = 0
+PUSH "\e[4:1m"
+ ?pen underline = 1
+PUSH "\e[4:2m"
+ ?pen underline = 2
+PUSH "\e[4:3m"
+ ?pen underline = 3
PUSH "\e[4m\e[m"
?pen underline = 0
while( my $line = <$test> ) {
$line =~ s/^\s+//;
+ chomp $line;
+
next if $line =~ m/^(?:#|$)/;
+ last if $line eq "__END__";
- chomp $line;
do_line( $line );
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 785,
/**/
784,
/**/