aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/eo/isa/eo_isa_main.c
blob: 567ef32542a7b48833b6a7e35ac9b2099bb46772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "Eo.h"
#include "eo_isa_simple.h"
#include "eo_isa_complex.h"

int
main(int argc, char *argv[])
{
   (void) argc;
   (void) argv;
   eo_init();

   Eo *simpleobj = eo_add(SIMPLE_CLASS, NULL);
   Eo *complexobj = eo_add(COMPLEX_CLASS, NULL);

   printf("Simple: isa-simple:%d isa-complex:%d isa-mixin:%d isa-interface:%d\n",
         eo_isa(simpleobj, SIMPLE_CLASS),
         eo_isa(simpleobj, COMPLEX_CLASS),
         eo_isa(simpleobj, MIXIN_CLASS),
         eo_isa(simpleobj, INTERFACE_CLASS));
   printf("Complex: isa-simple:%d isa-complex:%d isa-mixin:%d isa-interface:%d\n",
         eo_isa(complexobj, SIMPLE_CLASS),
         eo_isa(complexobj, COMPLEX_CLASS),
         eo_isa(complexobj, MIXIN_CLASS),
         eo_isa(complexobj, INTERFACE_CLASS));

   eo_unref(simpleobj);
   eo_unref(complexobj);

   eo_shutdown();
   return 0;
}