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

[tc_editline] Add callbacks for tab completion and hints #6

Open
darkuranium opened this issue Sep 8, 2016 · 0 comments
Open

[tc_editline] Add callbacks for tab completion and hints #6

darkuranium opened this issue Sep 8, 2016 · 0 comments

Comments

@darkuranium
Copy link
Owner

Currently, only a single callback exists. Instead, multiple events should be recognized and passed to the user.

I have already decided to go with option nr. 3, but for the record, there were three options:

  1. N callbacks registered separately

    void tcedit_register_tabcomplete(int (*cb)(<...>), void* udata);
    void tcedit_register_echo(<...>, void* udata);
  2. N callbacks registered at once (via a struct)

    typedef struct TC_EditHandler {
        int (*tabcomplete)(<...>);
        <...>
        void* udata;
    } TC_EditHandler;
    void tcedit_register_handler(TC_EditHandler* handler);
  3. A single callback which is passed an event type.

    typedef struct TC_EditEvent {
        int type;
        TC_String* input;
        <...>
    } TC_EditEvent;
    typedef int TC_EditCallback(TC_EditEvent* event, void* udata);
    void tcedit_register_callback(TC_EditCallback* callback, void* udata);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant