Commit Graph

48 Commits

Author SHA1 Message Date
roy
7f0204b5ec terminfo: v3 records should create v3 aliases 2020-03-30 00:09:06 +00:00
roy
7acb561444 tic: Duplicate and promote v1 records when merging a v3 record
When this occurs, tic merges the matching v1 record into the original v1.

The screen-256color record by itself doesn't have any numerics bigger
than a short, but the xterm+256setaf record does.

The screen-256color record is now as it was before the recent terminfo2.cdb
merge into terminfo.cdb.
2020-03-29 21:54:03 +00:00
roy
53fb7b3384 tic: free the old buffer after promoting the record type 2020-03-28 15:37:04 +00:00
roy
d58481db06 tic: use EXIT_FAILURE rather than magic numbers 2020-03-28 15:22:27 +00:00
roy
cd91284921 Whitespace 2020-03-28 15:20:30 +00:00
roy
f15baa5b00 tic: promote record type when merging newer into older 2020-03-28 15:19:56 +00:00
christos
f73231da8b Use the new functions and add more error checking. 2020-03-27 17:42:36 +00:00
christos
3958d16a96 As described in tech-userlevel:
- Modify the writing code to only write entries in the new
  format for the terminal descriptions that require it.
- Store new format entries as <name>@v3
- Store old format entries with clamped values as <name> for
  backwards compatibility
- Lookup first <name>@v3 and then <name> if that is not found.
- Don't create terminfo2 anymore; old programs keep working with
  clamped entries, and new programs be able to use the wide
  fields with using the original db file.
2020-03-27 15:11:57 +00:00
roy
aadfdb111b terminfo: promote numeric parameters from short to int
POSIX mandates implementations must support upto a short but may exceed it.
When NetBSD terminfo was implemented, no terminfo description used over
a short, but because ncurses has supported ints for some time, some now do.

Infact, such a terminfo description was imported where colour pairs for
screen-256color went up to 65536 which exposed a bug in the existing
implementation where it set to zero. Because the number might mean
something more than a range, we need to be able to store it accurately.

This requires a version bump because whilst the API hasn't changed thanks
to C int promotion, the ABI has. Also the underlying database structure
has changed as well - we now store the numeric paramter inside a uint32_t
field rather than a uint16_t one.
Whilst this change can still read the old style database, the old one
cannot read the new one and thus we now maintain the database as
terminfo2.cdb, leaving the old library and database alone so old programs
still work fine.

libcurses, libfrom, libmenu and libpanel have also been bumped to
accomoate this change.
2020-03-13 15:19:24 +00:00
joerg
2b691b877c unistd.h for close. 2017-10-02 21:53:55 +00:00
christos
9a21bc9318 fix the tools build. reported by Utkarsh Anand 2017-05-05 12:21:28 +00:00
roy
55c5fc2560 Remove __VALGRIND__ guard .... just clean up. 2017-05-04 14:07:33 +00:00
roy
e04b9c5743 Whitespace and formatting. 2017-05-04 13:53:36 +00:00
abhinav
98ea63c468 Fix spelling of "discovered" 2017-02-22 13:43:15 +00:00
christos
6dbf86bc11 need <sys/stat.h> for DEFFILEMODE etc. 2017-01-10 21:15:23 +00:00
christos
9896a45fe7 fix leak. 2016-11-24 17:12:23 +00:00
roy
061eb16dc2 White space police. 2016-02-24 12:01:44 +00:00
christos
ed61af43d9 use hdestroy1 now that hdestroy does not free the key. 2014-07-20 20:20:16 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
wiz
a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
joerg
d6b0aba16b Revert, there is a more fundamental issue with util.h. 2012-12-08 23:29:28 +00:00
joerg
52dd0a9cad Use util.h only in the native case. 2012-12-08 21:04:27 +00:00
mbalmer
d6d52f19c7 Remove an obsolete (and incomprehensible) comment. Discussed with and ok
Roy Marples, Joerg Sonnenberger.
2012-11-29 23:01:16 +00:00
joerg
fc67b0cd11 Switch terminfo(3) to cdb(5). 2012-06-03 23:19:09 +00:00
joerg
68a65e1a02 Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
2012-06-01 12:08:40 +00:00
joerg
7b1c18b0f7 Maintain nalias and nterm on the fly. 2012-05-31 21:01:06 +00:00
joerg
18604821d3 One more strdup -> estrdup. 2012-05-31 20:40:05 +00:00
joerg
cff379a94b Use e* from util.h. 2012-05-31 20:38:19 +00:00
joerg
2b5ab40700 Replace linear lookup with hash table, reducing runtime by 60%. 2012-05-31 20:10:06 +00:00
joerg
974fdf3721 Use queue(3) 2012-05-31 19:56:32 +00:00
joerg
968a666e92 Prefer __printflike. 2012-05-31 19:00:41 +00:00
roy
6a222e7196 Replace fgetln(3) with the more standard getline(3) 2011-11-09 07:40:27 +00:00
roy
ff10397929 Use memmove as we are effectively moving memory from left to right so
that the use=foo capability is removed when merging foo.
2011-11-03 10:12:57 +00:00
pgoyette
eb11ed074e Fix a couple of mis-spellings of "descriptions" 2011-11-02 19:21:49 +00:00
roy
fde317d2b1 libterminfo can now compile a single terminfo description which allows
$TERMINFO to be a terminfo description as well as a file reference.

This enables the user to modify the terminfo description on read-only
media.
2010-02-22 23:05:39 +00:00
pgoyette
3360c946f9 One more time - do this correctly.
Thanks, joerg.
2010-02-20 06:20:46 +00:00
pgoyette
4b2f1808e2 Wrap the include of sys/endian.h in #ifdef HAVE_SYS_ENDIAN_H to avoid
build issues on systems that don't have a sys/endian.h

Pointed out by joerg@
2010-02-20 06:15:06 +00:00
pgoyette
237e56a5c8 Since tic is a host tool, we need to include host system header to get
definitions of le16dec() and le16enc().

Solves PR bin/42747 from Henning Petersen
2010-02-20 06:08:01 +00:00
wiz
a2542d1a41 Oxford serial comma. 2010-02-11 13:44:14 +00:00
roy
b164f98a45 Change -S to output C structures to make life easier. 2010-02-11 13:09:57 +00:00
wiz
66fbc76fcb Sort options (standard order is 0-9AaBbCc...). 2010-02-11 07:00:46 +00:00
roy
55a396b95f tic -S now outputs the specified terminal names and compiled descriptions
as C strings so we can embed them into libterminfo.
2010-02-11 00:24:46 +00:00
roy
2bb24c0bfc Fix year. 2010-02-05 16:54:11 +00:00
roy
71dfbe1cc5 Note that -a no longer sets -x. 2010-02-05 16:36:09 +00:00
he
29cb6e1f41 More adaptation for ports where char is unsigned char. 2010-02-05 14:40:07 +00:00
roy
ae351fab5b Store the aliases against the entry, so that infocmp can reproduce them.
Handy for creating smaller terminfo databases.
2010-02-05 12:31:56 +00:00
wiz
fcf135c013 Use Ex for EXIT STATUS section. Put Ns on same line as previous,
to make clearer what happens.
2010-02-03 15:51:09 +00:00
roy
4ca00e00d8 Import my terminfo implementation.
This uses the ncurses terminal definitions.

OK: core@, jdc@
2010-02-03 15:16:32 +00:00