summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-11-18 20:08:17 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-11-18 20:08:17 +0000
commitf148916c23681d8f8bf9568ae877e985107ab83d (patch)
tree0b225263da446cd3512b9f0338aa6052dd76e6e2 /include/asterisk
parentf14aa7094707446e7e0162b407f577d9db0d15bb (diff)
Move this macro from cli.c to cli.h so apps can use it
without duplicating the macro or the code: /*! * In many cases we need to print singular or plural * words depending on a count. This macro helps us e.g. * printf("we have %d object%s", n, ESS(n)); */ #define ESS(x) ((x) == 1 ? "" : "s") git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/cli.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h
index 4f5d882de..6b8308e75 100644
--- a/include/asterisk/cli.h
+++ b/include/asterisk/cli.h
@@ -48,6 +48,13 @@ void ast_cli(int fd, char *fmt, ...)
#define AST_CLI_COMPLETE_EOF "_EOF_"
+/*!
+ * In many cases we need to print singular or plural
+ * words depending on a count. This macro helps us e.g.
+ * printf("we have %d object%s", n, ESS(n));
+ */
+#define ESS(x) ((x) == 1 ? "" : "s")
+
/*! \page CLI_command_api CLI command API
CLI commands are described by a struct ast_cli_entry that contains