dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.48k stars 112 forks source link

`ncselector_options->flags` seem to not do anything, why is it there? (ditto `ncmultiselector_options->flags`) #2642

Closed OBenjaminT closed 2 years ago

OBenjaminT commented 2 years ago

The flags field for ncselector_options and ncmultiselector_options are both processed like this in src/lib/selector.c:

if(opts->flags > 0){
  logwarn("provided unsupported flags %016" PRIx64, opts->flags);
}

Implying that setting any value for them is wrong.

Both of their typedefs in include/notcurses/notcurses.h and their man pages in doc/man/man3/notcurses_(multi)?selector.3.md comment them as bitfield of NC(MULTI)?SELECTOR_OPTION_*. and those are the only references to SELECTOR_OPTION in the entire repo:

$ rg SELECTOR_OPTION
include/notcurses/notcurses.h:
3907:   uint64_t flags;        // bitfield of NCSELECTOR_OPTION_*
3986:   uint64_t flags;        // bitfield of NCMULTISELECTOR_OPTION_*

doc/man/man3/notcurses_selector.3.md: 
38:  uint64_t flags;        // bitfield over NCSELECTOR_OPTION_*

doc/man/man3/notcurses_multiselector.3.md:
38:  uint64_t flags;        // bitfield over NCMULTISELECTOR_OPTION_*

What are they for? Why are they there? This is a userquestion because it's something I don't understand, but I think it should also be documented somewhere.

dankamongmen commented 2 years ago

they're just there for possible future expansion. i can't add fields to the struct without breaking ABI, so i always have the flags field, whether it's actively used or not. i'll add a note clarifying this, thanks!

dankamongmen commented 2 years ago

updated header and man pages.