From a175314c3e5827eb193872241446f2f8f5c9d33c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:07:14 +0200 Subject: Adding upstream version 1:10.5.12. Signed-off-by: Daniel Baumann --- dbug/my_main.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 dbug/my_main.c (limited to 'dbug/my_main.c') diff --git a/dbug/my_main.c b/dbug/my_main.c new file mode 100644 index 00000000..2b3e92b5 --- /dev/null +++ b/dbug/my_main.c @@ -0,0 +1,37 @@ +/* + this is modified version of the original example main.c + fixed so that it could compile and run in MySQL source tree +*/ + +#include /* This includes dbug.h */ +#include +#include + +int main (argc, argv) +int argc; +char *argv[]; +{ + register int result, ix; + extern int factorial(int); + MY_INIT(argv[0]); + + { + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) { + switch (argv[ix][1]) { + case '#': + DBUG_PUSH (&(argv[ix][2])); + break; + } + } + for (; ix < argc; ix++) { + DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix])); + result = factorial (atoi(argv[ix])); + printf ("%d\n", result); + } + DBUG_LEAVE; + } + my_end(0); + exit(0); +} -- cgit v1.2.3