File tree 3 files changed +56
-27
lines changed
3 files changed +56
-27
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ noinst_HEADERS = dbug_long.h
22
22
libdbug_a_SOURCES = dbug.c sanity.c
23
23
EXTRA_DIST = example1.c example2.c example3.c \
24
24
user.r monty.doc readme.prof dbug_add_tags.pl \
25
- main.c factorial.c dbug_analyze.c
25
+ my_main.c main.c factorial.c dbug_analyze.c
26
26
NROFF_INC = example1.r example2.r example3.r main.r \
27
27
factorial.r output1.r output2.r output3.r \
28
28
output4.r output5.r
29
29
30
30
31
31
# Must be linked with libs that are not compiled yet
32
32
noinst_PROGRAMS = factorial dbug_analyze
33
- factorial_SOURCES = main .c factorial.c
33
+ factorial_SOURCES = my_main .c factorial.c
34
34
dbug_analyze_SOURCES = dbug_analyze.c
35
35
36
36
all : user.t user.ps
Original file line number Diff line number Diff line change 1
- #ifdef DBUG_OFF /* We are testing dbug */
2
- #undef DBUG_OFF
3
- #endif
4
-
5
- #include <my_global.h> /* This includes dbug.h */
1
+ #include <dbug_long.h>
6
2
7
3
int main (argc , argv )
8
4
int argc ;
9
5
char * argv [];
10
6
{
11
- register int result , ix ;
7
+ int result , ix ;
12
8
extern int factorial (int );
13
- #if defined(HAVE_PTHREAD_INIT ) && defined(THREAD )
14
- pthread_init (); /* Must be called before DBUG_ENTER */
15
- #endif
16
- my_thread_global_init ();
17
- {
18
- DBUG_ENTER ("main" );
19
- DBUG_PROCESS (argv [0 ]);
20
- for (ix = 1 ; ix < argc && argv [ix ][0 ] == '-' ; ix ++ ) {
21
- switch (argv [ix ][1 ]) {
22
- case '#' :
23
- DBUG_PUSH (& (argv [ix ][2 ]));
24
- break ;
25
- }
26
- }
27
- for (; ix < argc ; ix ++ ) {
28
- DBUG_PRINT ("args" , ("argv[%d] = %s" , ix , argv [ix ]));
29
- result = factorial (atoi (argv [ix ]));
30
- printf ("%d\n" , result );
9
+ DBUG_ENTER ("main" );
10
+ DBUG_PROCESS (argv [0 ]);
11
+ for (ix = 1 ; ix < argc && argv [ix ][0 ] == '-' ; ix ++ ) {
12
+ switch (argv [ix ][1 ]) {
13
+ case '#' :
14
+ DBUG_PUSH (& (argv [ix ][2 ]));
15
+ break ;
31
16
}
32
- DBUG_RETURN (0 );
33
17
}
18
+ for (; ix < argc ; ix ++ ) {
19
+ DBUG_PRINT ("args" , ("argv[%d] = %s" , ix , argv [ix ]));
20
+ result = factorial (atoi (argv [ix ]));
21
+ printf ("%d\n" , result );
22
+ }
23
+ DBUG_RETURN (0 );
34
24
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ this is modified version of the original example main.c
3
+ fixed so that it could compile and run in MySQL source tree
4
+ */
5
+
6
+ #ifdef DBUG_OFF /* We are testing dbug */
7
+ #undef DBUG_OFF
8
+ #endif
9
+
10
+ #include <my_global.h> /* This includes dbug.h */
11
+
12
+ int main (argc , argv )
13
+ int argc ;
14
+ char * argv [];
15
+ {
16
+ register int result , ix ;
17
+ extern int factorial (int );
18
+ #if defined(HAVE_PTHREAD_INIT ) && defined(THREAD )
19
+ pthread_init (); /* Must be called before DBUG_ENTER */
20
+ #endif
21
+ my_thread_global_init ();
22
+ {
23
+ DBUG_ENTER ("main" );
24
+ DBUG_PROCESS (argv [0 ]);
25
+ for (ix = 1 ; ix < argc && argv [ix ][0 ] == '-' ; ix ++ ) {
26
+ switch (argv [ix ][1 ]) {
27
+ case '#' :
28
+ DBUG_PUSH (& (argv [ix ][2 ]));
29
+ break ;
30
+ }
31
+ }
32
+ for (; ix < argc ; ix ++ ) {
33
+ DBUG_PRINT ("args" , ("argv[%d] = %s" , ix , argv [ix ]));
34
+ result = factorial (atoi (argv [ix ]));
35
+ printf ("%d\n" , result );
36
+ }
37
+ DBUG_RETURN (0 );
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments