summaryrefslogtreecommitdiff
path: root/include/args.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/args.h')
-rw-r--r--include/args.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/include/args.h b/include/args.h
index cf6bcbef621c..515e53b1e891 100644
--- a/include/args.h
+++ b/include/args.h
@@ -46,10 +46,37 @@
* @param argv The array of arguments.
* @param exit_exprs True if bc/dc should exit when there are expressions,
* false otherwise.
- * @param scale The current scale.
+ * @param scale A pointer to return the scale that the arguments set, if
+ * any.
+ * @param ibase A pointer to return the ibase that the arguments set, if
+ * any.
+ * @param obase A pointer to return the obase that the arguments set, if
+ * any.
*/
void
-bc_args(int argc, char* argv[], bool exit_exprs, BcBigDig scale);
+bc_args(int argc, char* argv[], bool exit_exprs, BcBigDig* scale,
+ BcBigDig* ibase, BcBigDig* obase);
+
+#if BC_ENABLED
+
+#if DC_ENABLED
+
+/// Returns true if the banner should be quieted.
+#define BC_ARGS_SHOULD_BE_QUIET (BC_IS_DC || vm->exprs.len > 1)
+
+#else // DC_ENABLED
+
+/// Returns true if the banner should be quieted.
+#define BC_ARGS_SHOULD_BE_QUIET (vm->exprs.len > 1)
+
+#endif // DC_ENABLED
+
+#else // BC_ENABLED
+
+/// Returns true if the banner should be quieted.
+#define BC_ARGS_SHOULD_BE_QUIET (BC_IS_DC)
+
+#endif // BC_ENABLED
// A reference to the list of long options.
extern const BcOptLong bc_args_lopt[];