summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-09 18:45:27 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-13 16:59:58 +0100
commit37d2d378ec2e2d1f9a3941372ef4d818996291c7 (patch)
treee100879fbdc9ce0d2ce810be81977be97125603b /src/lib/ecore_con
parent3b2a5a429be16e5b8e5d322b7a077a2c849586b8 (diff)
eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which enabled those functions to be overwritten in classes inheriting another class. However in task T7675 we decided that this is not really good for bindings, as most OOP languages do not support this sort of feature. After this commit eolian realizes class function completly outside of the vtable, the c-symbol that is the class funciton is now just directly redirecting to a implementation, without the involvement of the vtable. This also means a change to the syntax created by eo: Calling before: class_function(CLASS_A); Calling after: class_function(); Implementation before: class_function(const Eo *obj, void *pd) { ... } Implementation after: class_function(void) { ... } This fixes T7675. Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br> Reviewed-by: Daniel Kolesa <daniel@octaforge.org> Differential Revision: https://phab.enlightenment.org/D7901
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_url.c2
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.c4
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c2
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.c2
-rw-r--r--src/lib/ecore_con/efl_net_ip_address.c16
-rw-r--r--src/lib/ecore_con/efl_net_ssl_context.c4
6 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index 3c9faea..dd8d249 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -734,7 +734,7 @@ _ecore_con_url_request_prepare(Ecore_Con_Url *url_con, const char *method)
734 734
735 if (url_con->time.condition != ECORE_CON_URL_TIME_NONE) 735 if (url_con->time.condition != ECORE_CON_URL_TIME_NONE)
736 { 736 {
737 char *ts = efl_net_dialer_http_date_serialize(EFL_NET_DIALER_HTTP_CLASS, url_con->time.stamp); 737 char *ts = efl_net_dialer_http_date_serialize(url_con->time.stamp);
738 if (ts) 738 if (ts)
739 { 739 {
740 efl_net_dialer_http_request_header_add(url_con->dialer, 740 efl_net_dialer_http_request_header_add(url_con->dialer,
diff --git a/src/lib/ecore_con/efl_net_dialer_http.c b/src/lib/ecore_con/efl_net_dialer_http.c
index 8bfe967..5378851 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -2375,14 +2375,14 @@ _efl_net_dialer_http_ssl_certificate_revocation_list_get(const Eo *o EINA_UNUSED
2375} 2375}
2376 2376
2377EOLIAN static int64_t 2377EOLIAN static int64_t
2378_efl_net_dialer_http_date_parse(Efl_Class *cls EINA_UNUSED, void *cd EINA_UNUSED, const char *str) 2378_efl_net_dialer_http_date_parse(const char *str)
2379{ 2379{
2380 EINA_SAFETY_ON_NULL_RETURN_VAL(str, 0); 2380 EINA_SAFETY_ON_NULL_RETURN_VAL(str, 0);
2381 return curl_getdate(str, NULL); 2381 return curl_getdate(str, NULL);
2382} 2382}
2383 2383
2384EOLIAN static char * 2384EOLIAN static char *
2385_efl_net_dialer_http_date_serialize(Efl_Class *cls EINA_UNUSED, void *cd EINA_UNUSED, int64_t ts) 2385_efl_net_dialer_http_date_serialize(int64_t ts)
2386{ 2386{
2387 static const char *const wkday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; 2387 static const char *const wkday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
2388 static const char * const month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 2388 static const char * const month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index 78b5879..33d314f 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -84,7 +84,7 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
84 else 84 else
85 { 85 {
86 if (!pd->ssl_ctx) 86 if (!pd->ssl_ctx)
87 pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get(EFL_NET_SSL_CONTEXT_CLASS)); 87 pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get());
88 88
89 efl_net_socket_ssl_adopt(o, pd->sock, pd->ssl_ctx); 89 efl_net_socket_ssl_adopt(o, pd->sock, pd->ssl_ctx);
90 } 90 }
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.c b/src/lib/ecore_con/efl_net_dialer_udp.c
index 953ae7d..b42e9d4 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.c
+++ b/src/lib/ecore_con/efl_net_dialer_udp.c
@@ -180,7 +180,7 @@ _efl_net_dialer_udp_resolved_bind(Eo *o, Efl_Net_Dialer_Udp_Data *pd EINA_UNUSED
180 } 180 }
181 } 181 }
182 182
183 remote_address = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, addr->ai_addr); 183 remote_address = efl_net_ip_address_create_sockaddr(addr->ai_addr);
184 if (remote_address) 184 if (remote_address)
185 { 185 {
186 efl_net_socket_udp_init(o, remote_address); 186 efl_net_socket_udp_init(o, remote_address);
diff --git a/src/lib/ecore_con/efl_net_ip_address.c b/src/lib/ecore_con/efl_net_ip_address.c
index 9a79c07..cc29aba 100644
--- a/src/lib/ecore_con/efl_net_ip_address.c
+++ b/src/lib/ecore_con/efl_net_ip_address.c
@@ -300,7 +300,7 @@ _efl_net_ip_address_any_check(const Eo *o EINA_UNUSED, Efl_Net_Ip_Address_Data *
300} 300}
301 301
302EOLIAN static Efl_Net_Ip_Address * 302EOLIAN static Efl_Net_Ip_Address *
303_efl_net_ip_address_create(Eo *cls, void *pd EINA_UNUSED, uint16_t port, const Eina_Slice address) 303_efl_net_ip_address_create(uint16_t port, const Eina_Slice address)
304{ 304{
305 int family; 305 int family;
306 306
@@ -311,26 +311,26 @@ _efl_net_ip_address_create(Eo *cls, void *pd EINA_UNUSED, uint16_t port, const E
311 else 311 else
312 family = AF_INET; 312 family = AF_INET;
313 313
314 return efl_add_ref(cls, efl_main_loop_get(), 314 return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
315 efl_net_ip_address_family_set(efl_added, family), 315 efl_net_ip_address_family_set(efl_added, family),
316 efl_net_ip_address_port_set(efl_added, port), 316 efl_net_ip_address_port_set(efl_added, port),
317 efl_net_ip_address_set(efl_added, address)); 317 efl_net_ip_address_set(efl_added, address));
318} 318}
319 319
320EOLIAN static Efl_Net_Ip_Address * 320EOLIAN static Efl_Net_Ip_Address *
321_efl_net_ip_address_create_sockaddr(Eo *cls, void *pd EINA_UNUSED, const void *ptr) 321_efl_net_ip_address_create_sockaddr(const void *ptr)
322{ 322{
323 const struct sockaddr *sockaddr = ptr; 323 const struct sockaddr *sockaddr = ptr;
324 324
325 EINA_SAFETY_ON_NULL_RETURN_VAL(sockaddr, NULL); 325 EINA_SAFETY_ON_NULL_RETURN_VAL(sockaddr, NULL);
326 EINA_SAFETY_ON_TRUE_RETURN_VAL((sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6), NULL); 326 EINA_SAFETY_ON_TRUE_RETURN_VAL((sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6), NULL);
327 327
328 return efl_add_ref(cls, efl_main_loop_get(), 328 return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
329 efl_net_ip_address_sockaddr_set(efl_added, sockaddr)); 329 efl_net_ip_address_sockaddr_set(efl_added, sockaddr));
330} 330}
331 331
332EOLIAN static Efl_Net_Ip_Address * 332EOLIAN static Efl_Net_Ip_Address *
333_efl_net_ip_address_parse(Eo *cls, void *pd EINA_UNUSED, const char *numeric_address) 333_efl_net_ip_address_parse(const char *numeric_address)
334{ 334{
335 struct sockaddr_storage ss; 335 struct sockaddr_storage ss;
336 Eina_Bool r; 336 Eina_Bool r;
@@ -368,7 +368,7 @@ _efl_net_ip_address_parse(Eo *cls, void *pd EINA_UNUSED, const char *numeric_add
368 return NULL; 368 return NULL;
369 } 369 }
370 370
371 return efl_add_ref(cls, efl_main_loop_get(), 371 return efl_add_ref(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
372 efl_net_ip_address_sockaddr_set(efl_added, &ss)); 372 efl_net_ip_address_sockaddr_set(efl_added, &ss));
373} 373}
374 374
@@ -509,7 +509,7 @@ _efl_net_ip_address_resolve_done(void *data,
509 if (EINA_UNLIKELY(_efl_net_ip_address_find(&r, a->ai_addr) >= 0)) 509 if (EINA_UNLIKELY(_efl_net_ip_address_find(&r, a->ai_addr) >= 0))
510 continue; 510 continue;
511 511
512 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, a->ai_addr); 512 o = efl_net_ip_address_create_sockaddr(a->ai_addr);
513 if (!o) continue ; 513 if (!o) continue ;
514 514
515 eina_value_array_append(&r, o); 515 eina_value_array_append(&r, o);
@@ -536,7 +536,7 @@ _efl_net_ip_address_resolve_done(void *data,
536} 536}
537 537
538EOLIAN static Eina_Future * 538EOLIAN static Eina_Future *
539_efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const char *address, int family, int flags) 539_efl_net_ip_address_resolve(const char *address, int family, int flags)
540{ 540{
541 Efl_Net_Ip_Address_Resolve_Context *ctx; 541 Efl_Net_Ip_Address_Resolve_Context *ctx;
542 struct addrinfo hints = { }; 542 struct addrinfo hints = { };
diff --git a/src/lib/ecore_con/efl_net_ssl_context.c b/src/lib/ecore_con/efl_net_ssl_context.c
index 271cd8a..a625fe8 100644
--- a/src/lib/ecore_con/efl_net_ssl_context.c
+++ b/src/lib/ecore_con/efl_net_ssl_context.c
@@ -357,11 +357,11 @@ _efl_net_ssl_context_default_dialer_del(void *data EINA_UNUSED, const Efl_Event
357} 357}
358 358
359EOLIAN static Efl_Net_Ssl_Context * 359EOLIAN static Efl_Net_Ssl_Context *
360_efl_net_ssl_context_default_dialer_get(const Efl_Class *klass, void *pd EINA_UNUSED) 360_efl_net_ssl_context_default_dialer_get(void)
361{ 361{
362 if (!_efl_net_ssl_context_default_dialer) 362 if (!_efl_net_ssl_context_default_dialer)
363 { 363 {
364 _efl_net_ssl_context_default_dialer = efl_add(klass, efl_main_loop_get(), 364 _efl_net_ssl_context_default_dialer = efl_add(EFL_NET_SSL_CONTEXT_CLASS, efl_main_loop_get(),
365 efl_net_ssl_context_verify_mode_set(efl_added, EFL_NET_SSL_VERIFY_MODE_REQUIRED), 365 efl_net_ssl_context_verify_mode_set(efl_added, EFL_NET_SSL_VERIFY_MODE_REQUIRED),
366 efl_net_ssl_context_hostname_verify_set(efl_added, EINA_TRUE), 366 efl_net_ssl_context_hostname_verify_set(efl_added, EINA_TRUE),
367 efl_net_ssl_context_default_paths_load_set(efl_added, EINA_TRUE), 367 efl_net_ssl_context_default_paths_load_set(efl_added, EINA_TRUE),