annotate examples/svg2code_ex/main.c @ 79:5bcb329a5157

Fix bug of core dump caused by forget to check if parent is NULL, root.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 20 Aug 2008 23:47:18 +0800
parents 3645e29e4986
children ea758bb3bbe2
rev   line source
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #include <stdio.h>
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 #include <mb_types.h>
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 #include <X_supp.h>
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 #include "svg2code_ex.h"
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 int main(int argc, char * const argv[]) {
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 X_MB_runtime_t rt;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 svg2code_ex_t *svg2code;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 int r;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10
79
5bcb329a5157 Fix bug of core dump caused by forget to check if parent is NULL, root.
Thinker K.F. Li <thinker@branda.to>
parents: 78
diff changeset
11 r = X_MB_init(":0.0", 800, 600, &rt);
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 svg2code = svg2code_ex_new(rt.rdman);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 X_MB_handle_connection(rt.display, rt.rdman, rt.tman);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 X_MB_destroy(&rt);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 return 0;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 }