2
this is modified version of the original example main.c
3
fixed so that it could compile and run in MySQL source tree
6
#ifdef DBUG_OFF /* We are testing dbug */
10
#include <my_global.h> /* This includes dbug.h */
11
#include <my_pthread.h>
17
register int result, ix;
18
extern int factorial(int);
19
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
20
pthread_init(); /* Must be called before DBUG_ENTER */
23
my_thread_global_init();
27
DBUG_PROCESS (argv[0]);
28
for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) {
29
switch (argv[ix][1]) {
31
DBUG_PUSH (&(argv[ix][2]));
35
for (; ix < argc; ix++) {
36
DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix]));
37
result = factorial (atoi(argv[ix]));
38
printf ("%d\n", result);