From 19eaa4ad92cd3288dd14c3e910c00fba9878733e Mon Sep 17 00:00:00 2001 From: lum Date: Thu, 6 May 2021 12:44:21 +0000 Subject: [PATCH] Add a number to parameters for ewprintf() via beeping. --- usr.bin/mg/bell.c | 10 +++++++++- usr.bin/mg/def.h | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/usr.bin/mg/bell.c b/usr.bin/mg/bell.c index 8cec1258e82..ef7e93b8620 100644 --- a/usr.bin/mg/bell.c +++ b/usr.bin/mg/bell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bell.c,v 1.5 2019/07/17 18:18:37 lum Exp $ */ +/* $OpenBSD: bell.c,v 1.6 2021/05/06 12:44:21 lum Exp $ */ /* * This file is in the public domain. @@ -26,6 +26,14 @@ bellinit(void) dovisiblebell = 0; } +int +dobeep_num(const char *msg, int n) +{ + ewprintf("%s %d", msg, n); + dobeep(); + return (FALSE); +} + int dobeep_msgs(const char *msg, const char *s) { diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index c9a0994aa0b..75167fc5df8 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.174 2021/05/03 12:18:43 lum Exp $ */ +/* $OpenBSD: def.h,v 1.175 2021/05/06 12:44:21 lum Exp $ */ /* This file is in the public domain. */ @@ -729,6 +729,7 @@ int compile(int, int); void bellinit(void); int toggleaudiblebell(int, int); int togglevisiblebell(int, int); +int dobeep_num(const char *, int); int dobeep_msgs(const char *, const char *); int dobeep_msg(const char *); void dobeep(void); -- 2.20.1