本文整理匯總了C++中ECORE_MAGIC_FAIL函數的典型用法代碼示例。如果您正苦於以下問題:C++ ECORE_MAGIC_FAIL函數的具體用法?C++ ECORE_MAGIC_FAIL怎麽用?C++ ECORE_MAGIC_FAIL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ECORE_MAGIC_FAIL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ecore_animator_del
EAPI void *
ecore_animator_del(Ecore_Animator *animator)
{
void *data = NULL;
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
goto unlock;
}
if (animator->delete_me)
{
data = animator->data;
goto unlock;
}
animator->delete_me = EINA_TRUE;
animators_delete_me++;
if (animator->run_func)
data = animator->run_data;
else
data = animator->data;
unlock:
_ecore_unlock();
return data;
}
示例2: ecore_timer_pending_get
/**
* Get the pending time regarding a timer.
*
* @param timer The timer to learn from.
* @ingroup Ecore_Time_Group
*/
EAPI double
ecore_timer_pending_get(Ecore_Timer *timer)
{
double now;
double ret = 0.0;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
"ecore_timer_pending_get");
goto unlock;
}
now = ecore_time_get();
if (timer->frozen)
ret = timer->pending;
else
ret = timer->at - now;
unlock:
_ecore_unlock();
return ret;
}
示例3: ecore_timer_thaw
/**
* Resumes a frozen (paused) timer.
*
* @param timer The timer to be resumed.
*
* The timer will be resumed from its previous relative position in time. That
* means, if it had X seconds remaining until expire when it was paused, it will
* be started now with those same X seconds remaining to expire again. But
* notice that the interval time won't be touched by this call or by
* ecore_timer_freeze().
*
* @see ecore_timer_freeze()
*/
EAPI void
ecore_timer_thaw(Ecore_Timer *timer)
{
double now;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
"ecore_timer_thaw");
goto unlock;
}
/* Timer not frozen */
if (!timer->frozen)
goto unlock;
suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer));
now = ecore_time_get();
_ecore_timer_set(timer, timer->pending + now, timer->in, timer->func, timer->data);
unlock:
_ecore_unlock();
}
示例4: ecore_con_url_http_post_send
/**
* Send a Curl httppost
* @return 1 on success, 0 on error.
* @ingroup Ecore_Con_Url_Group
*/
EAPI int
ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *httppost)
{
#ifdef HAVE_CURL
if (url_con->post)
curl_formfree(url_con->post);
url_con->post = NULL;
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_http_post_send");
return 0;
}
url_con->post = httppost;
if (url_con->active) return 0;
if (!url_con->url) return 0;
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPPOST, httppost);
return ecore_con_url_send(url_con, NULL, 0, NULL);
#else
return 0;
url_con = NULL;
#endif
}
示例5: ecore_con_url_url_set
/**
* Sets the URL to send the request to.
*
* @param url_con Connection object through which the request will be sent.
* @param url URL that will receive the request
*
* @return 1 on success, 0 on error.
*
* @ingroup Ecore_Con_Url_Group
*/
EAPI int
ecore_con_url_url_set(Ecore_Con_Url *url_con, const char *url)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_url_set");
return 0;
}
if (url_con->active) return 0;
if (url_con->url) free(url_con->url);
url_con->url = NULL;
if (url) url_con->url = strdup(url);
if (url_con->url)
curl_easy_setopt(url_con->curl_easy, CURLOPT_URL, url_con->url);
else
curl_easy_setopt(url_con->curl_easy, CURLOPT_URL, "");
return 1;
#else
return 0;
url_con = NULL;
url = NULL;
#endif
}
示例6: ecore_con_url_httpauth_set
/**
* Sets url_con to use http auth, with given username and password, "safely" or not.
*
* @param url_con Connection object to perform a request on, previously created
* with ecore_con_url_new() or ecore_con_url_custom_new().
* @param username Username to use in authentication
* @param password Password to use in authentication
* @param safe Whether to use "safer" methods (eg, NOT http basic auth)
*
* @return 1 on success, 0 on error.
*
* @ingroup Ecore_Con_Url_Group
*/
EAPI int
ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const char *username, const char *password, Eina_Bool safe)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_httpauth_set");
return 0;
}
# ifdef CURLOPT_USERNAME
# ifdef CURLOPT_PASSWORD
if ((username != NULL) && (password != NULL))
{
if (safe)
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
else
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_easy_setopt(url_con->curl_easy, CURLOPT_USERNAME, username);
curl_easy_setopt(url_con->curl_easy, CURLOPT_PASSWORD, password);
return 1;
}
# endif
# endif
#endif
return 0;
}
示例7: ecore_imf_context_del
EAPI void
ecore_imf_context_del(Ecore_IMF_Context *ctx)
{
Ecore_IMF_Func_Node *fn;
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_del");
return;
}
if (show_req_ctx == ctx)
show_req_ctx = NULL;
if (ctx->klass->del) ctx->klass->del(ctx);
if (ctx->callbacks)
{
EINA_LIST_FREE(ctx->callbacks, fn)
free(fn);
}
if (ctx->input_panel_callbacks)
{
EINA_LIST_FREE(ctx->input_panel_callbacks, fn)
free(fn);
}
ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
free(ctx);
}
示例8: ecore_exe_free
EAPI void *
ecore_exe_free(Ecore_Exe *exe)
{
void *data;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_free");
return NULL;
}
data = exe->data;
if (exe->pre_free_cb)
exe->pre_free_cb(data, exe);
CloseHandle(exe->process2);
CloseHandle(exe->process_thread);
CloseHandle(exe->process);
free(exe->cmd);
_ecore_exe_win32_pipes_close(exe);
exes = (Ecore_Exe *)eina_inlist_remove(EINA_INLIST_GET(exes), EINA_INLIST_GET(exe));
ECORE_MAGIC_SET(exe, ECORE_MAGIC_NONE);
if (exe->tag) free(exe->tag);
free(exe);
return data;
}
示例9: ecore_timer_interval_set
/**
* Change the interval the timer ticks of. If set during
* a timer call, this will affect the next interval.
*
* @param timer The timer to change.
* @param in The interval in seconds.
* @ingroup Ecore_Time_Group
*/
EAPI void ecore_timer_interval_set(Ecore_Timer * timer, double in)
{
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) {
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
"ecore_timer_interval_set");
return;
}
timer->in = in;
}
示例10: ecore_timer_interval_get
/**
* Get the interval the timer ticks on.
*
* @param timer The timer to retrieve the interval from
* @return The interval on success. -1 on failure.
* @ingroup Ecore_Time_Group
*/
EAPI double ecore_timer_interval_get(Ecore_Timer * timer)
{
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) {
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
"ecore_timer_interval_get");
return -1.0;
}
return timer->in;
}
示例11: ecore_exe_flags_get
EAPI Ecore_Exe_Flags
ecore_exe_flags_get(const Ecore_Exe *exe)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_data_get");
return 0;
}
return exe->flags;
}
示例12: ecore_exe_data_get
EAPI void *
ecore_exe_data_get(const Ecore_Exe *exe)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_data_get");
return NULL;
}
return exe->data;
}
示例13: ecore_exe_cmd_get
EAPI const char *
ecore_exe_cmd_get(const Ecore_Exe *exe)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_cmd_get");
return NULL;
}
return exe->cmd;
}
示例14: ecore_exe_pid_get
EAPI pid_t
ecore_exe_pid_get(const Ecore_Exe *exe)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_pid_get");
return -1;
}
return exe->process_id;
}
示例15: ecore_exe_close_stdin
EAPI void
ecore_exe_close_stdin(Ecore_Exe *exe)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_close_stdin");
return;
}
exe->close_stdin = 1;
}