[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: term.h internal capabilities
From: |
Anmol Sethi |
Subject: |
Re: term.h internal capabilities |
Date: |
Fri, 22 Apr 2016 22:10:53 -0400 |
I will implement one. It already checks for the magic number at the beginning.
What sort of sanity checks do you mean? I make sure the file is at least as
long as the header says it should be. Anything else?
> On Apr 22, 2016, at 8:55 PM, Thomas Dickey <address@hidden> wrote:
>
> On Fri, Apr 22, 2016 at 03:46:43PM -0400, Anmol Sethi wrote:
>> What are the internal capabilities in term.h used for?
>> https://gist.github.com/nhooyr/e80b92ea08cc2a67cd0a3ceeca94744d
>
> The ncurses library reads the compiled terminfo data into memory,
> making an index to the data. The names in term.h are the index.
> Some programs use this data structure directly. Others get the
> terminal capabilities using tigetflag (booleans), tigetnum (numbers)
> and tigetstr (strings).
>
> The in-memory data structure is based on the compiled form, but
> not identical. The compiled form is described in term(5).
>
>> I’m writing a pure go terminfo library and I’m not sure if I need to define
>> these capabilities. I’m assuming no?
>
> no. But read term(5), and consider implementing a reader for the
> extended capabilities. Your reader should check the magic code at
> the beginning, and do some sanity checking -- the ncurses library
> may be helpful.
>
> --
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net