Initialize Tizen 2.3
[framework/uifw/embryo.git] / mobile / src / lib / embryo_main.c
1 #ifdef HAVE_CONFIG_H
2 # include "config.h"
3 #endif
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <time.h>
8
9 #include "Embryo.h"
10 #include "embryo_private.h"
11
12 static Embryo_Version _version = { VMAJ, VMIN, VMIC, VREV };
13 EAPI Embryo_Version *embryo_version = &_version;
14
15 static int _embryo_init_count = 0;
16
17 /*** EXPORTED CALLS ***/
18
19 EAPI int
20 embryo_init(void)
21 {
22    if (++_embryo_init_count != 1)
23      return _embryo_init_count;
24
25    srand(time(NULL));
26
27    return _embryo_init_count;
28 }
29
30 EAPI int
31 embryo_shutdown(void)
32 {
33    if (_embryo_init_count <= 0)
34      {
35         printf("%s:%i Init count not greater than 0 in shutdown.", __FUNCTION__, __LINE__);
36         return 0;
37      }
38    if (--_embryo_init_count != 0)
39      return _embryo_init_count;
40
41    return _embryo_init_count;
42 }