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

Add bind defined values to docs #1521

Merged
merged 7 commits into from
Jan 20, 2024
Merged

Add bind defined values to docs #1521

merged 7 commits into from
Jan 20, 2024

Conversation

vanosg
Copy link
Member

@vanosg vanosg commented Dec 31, 2023

Found by: Geo
Patch by: Geo
Fixes: #1446

One-line summary:
Add explanations of #define'd values commonly used in creating Tcl binds when building new modules

@thommey please review and fix anything- some of this is just guesswork from looking at code. Specifically, MATCH_MODE, BIND_WANTRET, BIND_ALTER_ARGS, BIND_AMBIGUOUS, BIND_QUIT

@vanosg vanosg added this to the v1.10.0 milestone Dec 31, 2023
+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_CASE | Check the triggering value exactly against the bind mask value (case sensitive) |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_MASK | Check if the bind mask is contained within the triggering value, as a wildcarded value |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "contained" is right, it checks if it matches fully

+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_MASK | Check if the bind mask is contained within the triggering value, as a wildcarded value |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_MODE | Check if the triggering value is contained within the bind mask, as a wildcarded value |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mask is like MATCH_MASK until the first space, then it is MATCH_CASE. Specifically written for mode binds where "#channel +o" case is irrelevant for #channel but matters for +o.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write this one up

Copy link
Member

@thommey thommey Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special mode for bind mode which is like MATCH_MASK but case insensitive before the first space and case sensitive after

+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_MODE | Check if the triggering value is contained within the bind mask, as a wildcarded value |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| MATCH_CRON | Check the triggering value against a bind mask formatted as a cron entry, ie "30 7 6 7 * " triggers a mask for "30 7 * * * " |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example should not contain * anymore, it is triggered with concrete values like "30 7 6 7 5"

+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| BIND_STACKRET | Used with BIND_WANTRET; allow stacked binds to continue despite receiving a '1' |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------+
| BIND_ALTER_ARGS | Replaces arguments (which ones?) with the result returned from the called Tcl proc |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't figure out what this was ever used for and it is not currently used for any bind types in Eggdrop. I propose leaving it undocumented.

+----------------+--------------------------------------------------------------------------------------------------------------+
| BIND_EXEC_LOG | The bind criteria was met, the Tcl proc was called, and Eggdrop logged the bind being called |
+----------------+--------------------------------------------------------------------------------------------------------------+
| BIND_QUIT | The bind was triggered in conjunction with the target leaving the partyline or filesys area (?) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.quit is bound to a special value CMD_LEAVE that doesn't really trigger a bind but sets the Tcl result to the magic string "break" which is then used to detect this and signal the intention to quit the partyline/filesys by making the bind call return BIND_QUIT

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write this one up

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentinel value to signal .quit was triggered to leave the current partyline/filesys area (virtual bind to CMD_LEAVE)

@vanosg vanosg merged commit c0f9afe into develop Jan 20, 2024
2 checks passed
@vanosg vanosg deleted the docs/bindvalues branch February 5, 2024 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bind documentation update
2 participants