diff options
Diffstat (limited to 'dbug/main.c')
-rw-r--r-- | dbug/main.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/dbug/main.c b/dbug/main.c new file mode 100644 index 00000000000..863b4d319c2 --- /dev/null +++ b/dbug/main.c @@ -0,0 +1,33 @@ +#ifdef DBUG_OFF /* We are testing dbug */ +#undef DBUG_OFF +#endif + +#include <global.h> /* This includes dbug.h */ + +int main (argc, argv) +int argc; +char *argv[]; +{ + register int result, ix; + extern int factorial(int); +#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif + { + 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_RETURN (0); + } +} |