=== modified file 'Makefile' --- Makefile 2011-08-28 16:50:18 +0000 +++ Makefile 2011-08-28 16:47:11 +0000 @@ -67,7 +67,6 @@ ln -sf termkey_getkey.3.gz $(DESTDIR)$(MAN3DIR)/termkey_getkey_force.3.gz ln -sf termkey_set_waittime.3.gz $(DESTDIR)$(MAN3DIR)/termkey_get_waittime.3.gz ln -sf termkey_set_flags.3.gz $(DESTDIR)$(MAN3DIR)/termkey_get_flags.3.gz - ln -sf termkey_set_canonflags.3.gz $(DESTDIR)$(MAN3DIR)/termkey_get_canonflags.3.gz # DIST CUT === modified file 't/20canon.c' --- t/20canon.c 2011-08-28 16:50:18 +0000 +++ t/20canon.c 2011-08-27 18:59:02 +0000 @@ -29,7 +29,7 @@ is_str(key.utf8, " ", "key.utf8 for Space/unicode"); is_str(endp, "", "consumed entire input for Space/unicode"); - termkey_set_canonflags(tk, termkey_get_canonflags(tk) | TERMKEY_CANON_SPACESYMBOL); + termkey_set_flags(tk, termkey_get_flags(tk) | TERMKEY_FLAG_SPACESYMBOL); CLEAR_KEY; endp = termkey_strpkey(tk, " ", &key, 0); === modified file 'termkey-internal.h' --- termkey-internal.h 2011-08-28 16:50:18 +0000 +++ termkey-internal.h 2009-11-26 00:27:58 +0000 @@ -33,7 +33,6 @@ struct _TermKey { int fd; int flags; - int canonflags; unsigned char *buffer; size_t buffstart; // First offset in buffer size_t buffcount; // NUMBER of entires valid in buffer === modified file 'termkey.c' --- termkey.c 2011-08-28 16:50:18 +0000 +++ termkey.c 2011-08-27 18:59:02 +0000 @@ -198,10 +198,6 @@ tk->fd = fd; tk->flags = flags; - tk->canonflags = 0; - - if(flags & TERMKEY_FLAG_SPACESYMBOL) - tk->canonflags |= TERMKEY_CANON_SPACESYMBOL; tk->buffer = malloc(buffsize); if(!tk->buffer) @@ -377,11 +373,6 @@ void termkey_set_flags(TermKey *tk, int newflags) { tk->flags = newflags; - - if(tk->flags & TERMKEY_FLAG_SPACESYMBOL) - tk->canonflags |= TERMKEY_CANON_SPACESYMBOL; - else - tk->canonflags &= ~TERMKEY_CANON_SPACESYMBOL; } void termkey_set_waittime(TermKey *tk, int msec) @@ -394,21 +385,6 @@ return tk->waittime; } -int termkey_get_canonflags(TermKey *tk) -{ - return tk->canonflags; -} - -void termkey_set_canonflags(TermKey *tk, int flags) -{ - tk->canonflags = flags; - - if(tk->canonflags & TERMKEY_CANON_SPACESYMBOL) - tk->flags |= TERMKEY_FLAG_SPACESYMBOL; - else - tk->flags &= ~TERMKEY_FLAG_SPACESYMBOL; -} - static void eat_bytes(TermKey *tk, size_t count) { if(count >= tk->buffcount) { @@ -595,9 +571,9 @@ void termkey_canonicalise(TermKey *tk, TermKeyKey *key) { - int flags = tk->canonflags; + int flags = tk->flags; - if(flags & TERMKEY_CANON_SPACESYMBOL) { + if(flags & TERMKEY_FLAG_SPACESYMBOL) { if(key->type == TERMKEY_TYPE_UNICODE && key->code.number == 0x20) { key->type = TERMKEY_TYPE_KEYSYM; key->code.sym = TERMKEY_SYM_SPACE; === modified file 'termkey.h.in' --- termkey.h.in 2011-08-28 16:50:18 +0000 +++ termkey.h.in 2011-08-27 18:59:02 +0000 @@ -144,15 +144,11 @@ TERMKEY_FLAG_RAW = 1 << 2, // Input is raw bytes, not UTF-8 TERMKEY_FLAG_UTF8 = 1 << 3, // Input is definitely UTF-8 TERMKEY_FLAG_NOTERMIOS = 1 << 4, // Do not make initial termios calls on construction - TERMKEY_FLAG_SPACESYMBOL = 1 << 5, // Sets TERMKEY_CANON_SPACESYMBOL + TERMKEY_FLAG_SPACESYMBOL = 1 << 5, // Space is symbolic rather than Unicode TERMKEY_FLAG_CTRLC = 1 << 6, // Allow Ctrl-C to be read as normal, disabling SIGINT TERMKEY_FLAG_EINTR = 1 << 7 // Return ERROR on signal (EINTR) rather than retry }; -enum { - TERMKEY_CANON_SPACESYMBOL = 1 << 0, // Space is symbolic rather than Unicode -}; - void termkey_check_version(int major, int minor); TermKey *termkey_new(int fd, int flags); @@ -167,9 +163,6 @@ int termkey_get_waittime(TermKey *tk); void termkey_set_waittime(TermKey *tk, int msec); -int termkey_get_canonflags(TermKey *tk); -void termkey_set_canonflags(TermKey *tk, int); - void termkey_canonicalise(TermKey *tk, TermKeyKey *key); TermKeyResult termkey_getkey(TermKey *tk, TermKeyKey *key); === modified file 'termkey_canonicalise.3' --- termkey_canonicalise.3 2011-08-28 16:50:18 +0000 +++ termkey_canonicalise.3 2011-08-27 18:59:02 +0000 @@ -10,15 +10,15 @@ .sp Link with \fI-ltermkey\fP. .SH DESCRIPTION -\fBtermkey_canonicalise\fP(3) modifies the key event structure given by \fIkey\fP according to the canonicalisation flags set on the given \fItk\fP instance. This operation is performed implicitly by \fBtermkey_getkey\fP(3), \fBtermkey_waitkey\fP(3) and \fBtermkey_strpkey\fP(3), and is also provided explicitly by this function. +\fBtermkey_canonicalise\fP(3) modifies the key event structure given by \fIkey\fP according to the flags set on the given \fItk\fP instance. This operation is performed implicitly by \fBtermkey_getkey\fP(3), \fBtermkey_waitkey\fP(3) and \fBtermkey_strpkey\fP(3), and is also provided explicitly by this function. .PP The canonicalisation operation is affected by the following flags: .TP -.B TERMKEY_CANON_SPACESYMBOL +.B TERMKEY_FLAG_SPACESYMBOL If this flag is set then a Unicode space character is represented using the \fBTERMKEY_SYM_SPACE\fP symbol. If this flag is not set, it is represented by the U+0020 Unicode codepoint. .SH "RETURN VALUE" \fBtermkey_canonicalise\fP() returns no value. .SH "SEE ALSO" -.BR termkey_set_canonflags (3), +.BR termkey_new (3), .BR termkey_waitkey (3), .BR termkey_strpkey (3) === removed file 'termkey_set_canonflags.3' --- termkey_set_canonflags.3 2011-08-28 16:50:18 +0000 +++ termkey_set_canonflags.3 1970-01-01 00:00:00 +0000 @@ -1,21 +0,0 @@ -.TH TERMKEY_SET_CANONFLAGS 3 -.SH NAME -termkey_set_canonflags, termkey_get_canonflags \- control the canonicalisation flags -.SH SYNOPSIS -.nf -.B #include -.sp -.BI "void termkey_set_canonflags(TermKey *" tk ", int " newflags ); -.BI "int termkey_get_canonflags(TermKey *" tk ); -.fi -.sp -Link with \fI-ltermkey\fP. -.SH DESCRIPTION -\fBtermkey_set_canonflags\fP() changes the set of canonicalisation flags in the termkey instance to those given by \fInewflags\fP. For detail on the available flags and their meaning, see \fBtermkey_set_canonflags\fP(3). -.PP -\fBtermkey_get_canonflags\fP() returns the value set by the last call to \fBtermkey_set_canonflags\fP(). -.SH "RETURN VALUE" -\fBtermkey_set_flags\fP() returns no value. \fBtermkey_get_flags\fP() returns the current canonicalisation flags. -.SH "SEE ALSO" -.BR termkey_new (3), -.BR termkey_canonicalise (3)