diff --git a/bestline.c b/bestline.c index ba2654d..62e66be 100644 --- a/bestline.c +++ b/bestline.c @@ -3612,13 +3612,22 @@ void bestlineMaskModeDisable(void) { } /** - * Enables or disables "balance mode". + * Enables "balance mode". * * When it is enabled, bestline() will block until parentheses are * balanced. This is useful for code but not for free text. + * + * @see bestlineBalanceModeDisable() + */ +void bestlineBalanceModeEnable(void) { + balancemode = 1; +} + +/** + * Disables "balance mode". */ -void bestlineBalanceMode(char mode) { - balancemode = mode; +void bestlineBalanceModeDisable(void) { + balancemode = 0; } /** diff --git a/bestline.h b/bestline.h index 93653dc..23c4bbe 100644 --- a/bestline.h +++ b/bestline.h @@ -30,7 +30,8 @@ void bestlineHistoryFree(void); void bestlineClearScreen(int); void bestlineMaskModeEnable(void); void bestlineMaskModeDisable(void); -void bestlineBalanceMode(char); +void bestlineBalanceModeEnable(void); +void bestlineBalanceModeDisable(void); void bestlineUserIO(void *userReadFn, void *userWriteFn, void *userPollFn); void bestlineDisableRawMode(void); void bestlineFree(void *); diff --git a/example.c b/example.c index 90cc7cd..8750a2b 100644 --- a/example.c +++ b/example.c @@ -69,9 +69,9 @@ int main(int argc, char **argv) { } else if (!strncmp(line, "/unmask", 7)) { bestlineMaskModeDisable(); } else if (!strncmp(line, "/balance", 8)) { - bestlineBalanceMode(1); + bestlineBalanceModeEnable(); } else if (!strncmp(line, "/unbalance", 10)) { - bestlineBalanceMode(0); + bestlineBalanceModeDisable(); } else if (line[0] == '/') { fputs("Unreconized command: ", stdout); fputs(line, stdout);