2014-04-14 13:21:03 -07:00
|
|
|
# Copyright (C) 2007-2014 various contributors (see AUTHORS)
|
2013-02-14 12:54:53 -08:00
|
|
|
#
|
|
|
|
# This file is part of Python-EFL.
|
|
|
|
#
|
|
|
|
# Python-EFL is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
2013-12-07 08:54:58 -08:00
|
|
|
# version 3 of the License, or (at your option) any later version.
|
2013-02-14 12:54:53 -08:00
|
|
|
#
|
|
|
|
# Python-EFL is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2013-10-23 04:34:42 -07:00
|
|
|
from cpython cimport va_list
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
cdef extern from "time.h":
|
|
|
|
struct tm:
|
|
|
|
int tm_sec
|
|
|
|
int tm_min
|
|
|
|
int tm_hour
|
|
|
|
int tm_mday
|
|
|
|
int tm_mon
|
|
|
|
int tm_year
|
|
|
|
int tm_wday
|
|
|
|
int tm_yday
|
|
|
|
int tm_isdst
|
|
|
|
|
|
|
|
long int tm_gmtoff
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *tm_zone
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
cdef extern from "Eina.h":
|
|
|
|
####################################################################
|
|
|
|
# Enumerations
|
|
|
|
#
|
2013-10-23 04:34:42 -07:00
|
|
|
ctypedef enum Eina_Log_Level:
|
|
|
|
EINA_LOG_LEVEL_CRITICAL # Critical log level
|
|
|
|
EINA_LOG_LEVEL_ERR # Error log level
|
|
|
|
EINA_LOG_LEVEL_WARN # Warning log level
|
|
|
|
EINA_LOG_LEVEL_INFO # Information log level
|
|
|
|
EINA_LOG_LEVEL_DBG # Debug log level
|
|
|
|
EINA_LOG_LEVELS # Count of default log levels
|
|
|
|
EINA_LOG_LEVEL_UNKNOWN = (-2147483647 - 1) # Unknown level
|
|
|
|
|
|
|
|
ctypedef enum Eina_Log_State:
|
|
|
|
EINA_LOG_STATE_START
|
|
|
|
EINA_LOG_STATE_STOP
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Basic Types
|
|
|
|
#
|
|
|
|
ctypedef unsigned char Eina_Bool
|
|
|
|
ctypedef int Eina_Error
|
2014-04-04 17:13:15 -07:00
|
|
|
ctypedef const char Eina_Stringshare
|
2013-04-07 16:11:50 -07:00
|
|
|
# This is actually either wchar_t or uint32_t, Cython
|
|
|
|
# should use an appropriate integer automatically
|
2013-04-08 10:49:28 -07:00
|
|
|
ctypedef Py_UCS4 Eina_Unicode
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Structures
|
|
|
|
#
|
|
|
|
ctypedef struct Eina_Rectangle:
|
|
|
|
int x
|
|
|
|
int y
|
|
|
|
int w
|
|
|
|
int h
|
|
|
|
|
|
|
|
ctypedef struct Eina_List:
|
|
|
|
void *data
|
|
|
|
Eina_List *next
|
|
|
|
Eina_List *prev
|
|
|
|
void *accounting
|
|
|
|
|
2013-03-30 08:32:10 -07:00
|
|
|
ctypedef struct Eina_Hash
|
|
|
|
|
2013-02-14 12:54:53 -08:00
|
|
|
ctypedef struct Eina_Hash_Tuple:
|
|
|
|
void *key
|
|
|
|
void *data
|
|
|
|
unsigned int key_length
|
|
|
|
|
|
|
|
ctypedef struct Eina_Iterator:
|
|
|
|
Eina_Bool (*next)(Eina_Iterator *it, void **data)
|
|
|
|
void *(*get_container)(Eina_Iterator *it)
|
|
|
|
void (*free)(Eina_Iterator *it)
|
|
|
|
|
2013-10-23 04:34:42 -07:00
|
|
|
ctypedef struct Eina_Log_Domain:
|
|
|
|
int level # Max level to log
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *domain_str # Formatted string with color to print
|
|
|
|
const char *name # Domain name
|
2013-10-23 04:34:42 -07:00
|
|
|
size_t namelen # strlen(name)
|
|
|
|
|
2013-02-14 12:54:53 -08:00
|
|
|
####################################################################
|
|
|
|
# Other typedefs
|
|
|
|
#
|
2014-04-04 17:13:15 -07:00
|
|
|
ctypedef int (*Eina_Compare_Cb)(const void *data1, const void *data2)
|
2013-03-30 08:32:10 -07:00
|
|
|
ctypedef void (*Eina_Free_Cb)(void *data)
|
2014-04-04 17:13:15 -07:00
|
|
|
ctypedef void (*Eina_Log_Print_Cb)(const Eina_Log_Domain *d,
|
2013-10-23 04:34:42 -07:00
|
|
|
Eina_Log_Level level,
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *file, const char *fnc, int line,
|
|
|
|
const char *fmt, void *data, va_list args)
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Functions
|
|
|
|
#
|
|
|
|
Eina_Error eina_error_get()
|
|
|
|
void eina_error_set(Eina_Error err)
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *eina_error_msg_get(Eina_Error error)
|
2013-02-14 12:54:53 -08:00
|
|
|
|
|
|
|
Eina_Bool eina_iterator_next(Eina_Iterator *iterator, void **data)
|
|
|
|
void eina_iterator_free(Eina_Iterator *iterator)
|
2013-02-18 12:53:55 -08:00
|
|
|
|
2014-04-04 17:13:15 -07:00
|
|
|
Eina_Stringshare *eina_stringshare_add_length(const char *str, unsigned int slen)
|
|
|
|
Eina_Stringshare *eina_stringshare_add(const char *str)
|
2013-02-18 12:53:55 -08:00
|
|
|
void eina_stringshare_del(Eina_Stringshare *str)
|
|
|
|
Eina_Stringshare *eina_stringshare_ref(Eina_Stringshare *str)
|
|
|
|
int eina_stringshare_strlen(Eina_Stringshare *str)
|
2014-04-04 17:13:15 -07:00
|
|
|
Eina_Bool eina_stringshare_replace(Eina_Stringshare **p_str, const char *news)
|
2013-03-22 23:50:33 -07:00
|
|
|
|
2013-02-14 12:54:53 -08:00
|
|
|
Eina_List *eina_list_free(Eina_List *list)
|
|
|
|
Eina_List *eina_list_append(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_prepend(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_append(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_prepend(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_append_relative(Eina_List *list, void *data, void *relative)
|
|
|
|
Eina_List *eina_list_append_relative_list(Eina_List *list, void *data, Eina_List *relative)
|
|
|
|
Eina_List *eina_list_prepend_relative(Eina_List *list, void *data, void *relative)
|
|
|
|
Eina_List *eina_list_prepend_relative_list(Eina_List *list, void *data, Eina_List *relative)
|
|
|
|
Eina_List *eina_list_sorted_insert(Eina_List *list, Eina_Compare_Cb func, void *data)
|
|
|
|
Eina_List *eina_list_remove(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_remove_list(Eina_List *list, Eina_List *remove_list)
|
|
|
|
Eina_List *eina_list_promote_list(Eina_List *list, Eina_List *move_list)
|
|
|
|
Eina_List *eina_list_demote_list(Eina_List *list, Eina_List *move_list)
|
|
|
|
void *eina_list_data_find(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_data_find_list(Eina_List *list, void *data)
|
|
|
|
Eina_List *eina_list_free(Eina_List *list)
|
|
|
|
void *eina_list_nth(Eina_List *list, unsigned int n)
|
|
|
|
Eina_List *eina_list_nth_list(Eina_List *list, unsigned int n)
|
|
|
|
Eina_List *eina_list_reverse(Eina_List *list)
|
|
|
|
Eina_List *eina_list_reverse_clone(Eina_List *list)
|
|
|
|
Eina_List *eina_list_clone(Eina_List *list)
|
|
|
|
Eina_List *eina_list_sort(Eina_List *list, unsigned int size, Eina_Compare_Cb func)
|
|
|
|
Eina_List *eina_list_merge(Eina_List *left, Eina_List *right)
|
|
|
|
Eina_List *eina_list_sorted_merge(Eina_List *left, Eina_List *right, Eina_Compare_Cb func)
|
|
|
|
Eina_List *eina_list_split_list(Eina_List *list, Eina_List *relative, Eina_List **right)
|
|
|
|
Eina_List *eina_list_search_sorted_near_list(Eina_List *list, Eina_Compare_Cb func, void *data, int *result_cmp)
|
|
|
|
Eina_List *eina_list_search_sorted_list(Eina_List *list, Eina_Compare_Cb func, void *data)
|
|
|
|
void *eina_list_search_sorted(Eina_List *list, Eina_Compare_Cb func, void *data)
|
|
|
|
Eina_List *eina_list_search_unsorted_list(Eina_List *list, Eina_Compare_Cb func, void *data)
|
|
|
|
void *eina_list_search_unsorted(Eina_List *list, Eina_Compare_Cb func, void *data)
|
|
|
|
Eina_List *eina_list_last(Eina_List *list)
|
|
|
|
Eina_List *eina_list_next(Eina_List *list)
|
|
|
|
Eina_List *eina_list_prev(Eina_List *list)
|
|
|
|
void *eina_list_data_get(Eina_List *list)
|
|
|
|
unsigned int eina_list_count(Eina_List *list)
|
2013-03-30 08:32:10 -07:00
|
|
|
|
|
|
|
Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb)
|
2014-04-04 17:13:15 -07:00
|
|
|
Eina_Bool eina_hash_add(Eina_Hash *hash, const void *key, const void *data)
|
|
|
|
Eina_Bool eina_hash_del(Eina_Hash *hash, const void *key, const void *data)
|
|
|
|
void *eina_hash_find(Eina_Hash *hash, const void *key)
|
2013-10-23 04:34:42 -07:00
|
|
|
|
|
|
|
void eina_log_threads_enable()
|
|
|
|
void eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data)
|
|
|
|
void eina_log_level_set(int level)
|
|
|
|
int eina_log_level_get()
|
|
|
|
Eina_Bool eina_log_main_thread_check()
|
|
|
|
void eina_log_function_disable_set(Eina_Bool disabled)
|
|
|
|
Eina_Bool eina_log_function_disable_get()
|
2014-04-04 17:13:15 -07:00
|
|
|
void eina_log_domain_level_set(const char *domain_name, int level)
|
|
|
|
int eina_log_domain_level_get(const char *domain_name)
|
2013-10-23 04:34:42 -07:00
|
|
|
int eina_log_domain_registered_level_get(int domain)
|
2014-04-04 17:13:15 -07:00
|
|
|
int eina_log_domain_register(const char *name, const char *color)
|
2013-10-23 04:34:42 -07:00
|
|
|
void eina_log_domain_unregister(int domain)
|
|
|
|
void eina_log_print(int domain,
|
|
|
|
Eina_Log_Level level,
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *file,
|
|
|
|
const char *fnc,
|
2013-10-23 04:34:42 -07:00
|
|
|
int line,
|
2014-04-04 17:13:15 -07:00
|
|
|
const char *fmt,
|
2013-10-23 04:34:42 -07:00
|
|
|
...)
|
|
|
|
|
2014-04-04 17:13:15 -07:00
|
|
|
void EINA_LOG_DOM_CRIT(int DOM, const char *fmt, ...)
|
|
|
|
void EINA_LOG_DOM_ERR(int DOM, const char *fmt, ...)
|
|
|
|
void EINA_LOG_DOM_WARN(int DOM, const char *fmt, ...)
|
|
|
|
void EINA_LOG_DOM_INFO(int DOM, const char *fmt, ...)
|
|
|
|
void EINA_LOG_DOM_DBG(int DOM, const char *fmt, ...)
|