Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OBenjaminT opened this issue Mar 31, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation userquestion not quite bugs--inquiries from users
Milestone

Comments

@OBenjaminT
Copy link

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.

@OBenjaminT OBenjaminT added the userquestion not quite bugs--inquiries from users label Mar 31, 2022
@dankamongmen dankamongmen self-assigned this Mar 31, 2022
@dankamongmen dankamongmen added the documentation Improvements or additions to documentation label Mar 31, 2022
@dankamongmen
Copy link
Owner

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
Copy link
Owner

updated header and man pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation userquestion not quite bugs--inquiries from users
Projects
None yet
Development

No branches or pull requests

2 participants