summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo_add_fallback.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-08-15 14:44:41 +0100
committerTom Hacohen <tom@stosb.com>2016-08-15 15:07:42 +0100
commite65aae994e72c1d3f8ac6b5360d3772f177b77ef (patch)
tree7ecaf136e45470635889191aded2b47057720a98 /src/lib/eo/eo_add_fallback.c
parent35abb3c34d10a4826c98055fb85ecf93915e5ea8 (diff)
Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for Eo_Event that will follow soon. Obviously breaks both API and ABI.
Diffstat (limited to 'src/lib/eo/eo_add_fallback.c')
-rw-r--r--src/lib/eo/eo_add_fallback.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/lib/eo/eo_add_fallback.c b/src/lib/eo/eo_add_fallback.c
index 6d714d6..7973fee 100644
--- a/src/lib/eo/eo_add_fallback.c
+++ b/src/lib/eo/eo_add_fallback.c
@@ -15,14 +15,14 @@
15 15
16// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023 16// 1024 entries == 16k or 32k (32 or 64bit) for eo call stack. that's 1023
17// imbricated/recursive calls it can handle before barfing. i'd say that's ok 17// imbricated/recursive calls it can handle before barfing. i'd say that's ok
18#define EO_CALL_STACK_DEPTH_MIN 1024 18#define EFL_OBJECT_CALL_STACK_DEPTH_MIN 1024
19 19
20typedef struct _Eo_Call_Stack { 20typedef struct _Efl_Object_Call_Stack {
21 Eo_Stack_Frame *frames; 21 Eo_Stack_Frame *frames;
22 Eo_Stack_Frame *frame_ptr; 22 Eo_Stack_Frame *frame_ptr;
23} Eo_Call_Stack; 23} Efl_Object_Call_Stack;
24 24
25#define EO_CALL_STACK_SIZE (EO_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame)) 25#define EFL_OBJECT_CALL_STACK_SIZE (EFL_OBJECT_CALL_STACK_DEPTH_MIN * sizeof(Eo_Stack_Frame))
26 26
27static Eina_TLS _eo_call_stack_key = 0; 27static Eina_TLS _eo_call_stack_key = 0;
28 28
@@ -63,16 +63,16 @@ _eo_call_stack_mem_free(void *ptr, size_t size)
63#endif 63#endif
64} 64}
65 65
66static Eo_Call_Stack * 66static Efl_Object_Call_Stack *
67_eo_call_stack_create() 67_eo_call_stack_create()
68{ 68{
69 Eo_Call_Stack *stack; 69 Efl_Object_Call_Stack *stack;
70 70
71 stack = calloc(1, sizeof(Eo_Call_Stack)); 71 stack = calloc(1, sizeof(Efl_Object_Call_Stack));
72 if (!stack) 72 if (!stack)
73 return NULL; 73 return NULL;
74 74
75 stack->frames = _eo_call_stack_mem_alloc(EO_CALL_STACK_SIZE); 75 stack->frames = _eo_call_stack_mem_alloc(EFL_OBJECT_CALL_STACK_SIZE);
76 if (!stack->frames) 76 if (!stack->frames)
77 { 77 {
78 free(stack); 78 free(stack);
@@ -88,24 +88,24 @@ _eo_call_stack_create()
88static void 88static void
89_eo_call_stack_free(void *ptr) 89_eo_call_stack_free(void *ptr)
90{ 90{
91 Eo_Call_Stack *stack = (Eo_Call_Stack *) ptr; 91 Efl_Object_Call_Stack *stack = (Efl_Object_Call_Stack *) ptr;
92 92
93 if (!stack) return; 93 if (!stack) return;
94 94
95 if (stack->frames) 95 if (stack->frames)
96 _eo_call_stack_mem_free(stack->frames, EO_CALL_STACK_SIZE); 96 _eo_call_stack_mem_free(stack->frames, EFL_OBJECT_CALL_STACK_SIZE);
97 97
98 free(stack); 98 free(stack);
99} 99}
100 100
101static Eo_Call_Stack *main_loop_stack = NULL; 101static Efl_Object_Call_Stack *main_loop_stack = NULL;
102 102
103#define _EO_CALL_STACK_GET() ((EINA_LIKELY(eina_main_loop_is())) ? main_loop_stack : _eo_call_stack_get_thread()) 103#define _EFL_OBJECT_CALL_STACK_GET() ((EINA_LIKELY(eina_main_loop_is())) ? main_loop_stack : _eo_call_stack_get_thread())
104 104
105static inline Eo_Call_Stack * 105static inline Efl_Object_Call_Stack *
106_eo_call_stack_get_thread(void) 106_eo_call_stack_get_thread(void)
107{ 107{
108 Eo_Call_Stack *stack = eina_tls_get(_eo_call_stack_key); 108 Efl_Object_Call_Stack *stack = eina_tls_get(_eo_call_stack_key);
109 109
110 if (stack) return stack; 110 if (stack) return stack;
111 111
@@ -116,18 +116,18 @@ _eo_call_stack_get_thread(void)
116} 116}
117 117
118EAPI Eo * 118EAPI Eo *
119_eo_self_get(void) 119_efl_self_get(void)
120{ 120{
121 return _EO_CALL_STACK_GET()->frame_ptr->obj; 121 return _EFL_OBJECT_CALL_STACK_GET()->frame_ptr->obj;
122} 122}
123 123
124Eo_Stack_Frame * 124Eo_Stack_Frame *
125_eo_add_fallback_stack_push(Eo *obj) 125_efl_add_fallback_stack_push(Eo *obj)
126{ 126{
127 Eo_Call_Stack *stack = _EO_CALL_STACK_GET(); 127 Efl_Object_Call_Stack *stack = _EFL_OBJECT_CALL_STACK_GET();
128 if (stack->frame_ptr == (stack->frames + EO_CALL_STACK_DEPTH_MIN)) 128 if (stack->frame_ptr == (stack->frames + EFL_OBJECT_CALL_STACK_DEPTH_MIN))
129 { 129 {
130 CRI("eo_add fallback stack overflow."); 130 CRI("efl_add fallback stack overflow.");
131 } 131 }
132 132
133 stack->frame_ptr++; 133 stack->frame_ptr++;
@@ -137,12 +137,12 @@ _eo_add_fallback_stack_push(Eo *obj)
137} 137}
138 138
139Eo_Stack_Frame * 139Eo_Stack_Frame *
140_eo_add_fallback_stack_pop(void) 140_efl_add_fallback_stack_pop(void)
141{ 141{
142 Eo_Call_Stack *stack = _EO_CALL_STACK_GET(); 142 Efl_Object_Call_Stack *stack = _EFL_OBJECT_CALL_STACK_GET();
143 if (stack->frame_ptr == stack->frames) 143 if (stack->frame_ptr == stack->frames)
144 { 144 {
145 CRI("eo_add fallback stack underflow."); 145 CRI("efl_add fallback stack underflow.");
146 } 146 }
147 147
148 stack->frame_ptr--; 148 stack->frame_ptr--;
@@ -151,7 +151,7 @@ _eo_add_fallback_stack_pop(void)
151} 151}
152 152
153Eina_Bool 153Eina_Bool
154_eo_add_fallback_init(void) 154_efl_add_fallback_init(void)
155{ 155{
156 if (_eo_call_stack_key != 0) 156 if (_eo_call_stack_key != 0)
157 WRN("_eo_call_stack_key already set, this should not happen."); 157 WRN("_eo_call_stack_key already set, this should not happen.");
@@ -176,7 +176,7 @@ _eo_add_fallback_init(void)
176} 176}
177 177
178Eina_Bool 178Eina_Bool
179_eo_add_fallback_shutdown(void) 179_efl_add_fallback_shutdown(void)
180{ 180{
181 if (_eo_call_stack_key != 0) 181 if (_eo_call_stack_key != 0)
182 { 182 {