diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /dbug/my_main.c | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.tar.xz mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dbug/my_main.c')
-rw-r--r-- | dbug/my_main.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 <my_global.h> /* This includes dbug.h */ +#include <my_sys.h> +#include <my_pthread.h> + +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); +} |