示例#1
0
int main(void)
{
    void *data;

    if (!eina_init())
    {
        printf ("Error during the initialization of eina_error module\n");
        return EXIT_FAILURE;
    }

    MY_ERROR_NEGATIVE = eina_error_msg_static_register("Negative number");
    MY_ERROR_NULL = eina_error_msg_static_register("NULL pointer");

    data = data_new();
    if (!data)
    {
        Eina_Error err;

        err = eina_error_get();
        if (err)
            printf("Error during memory allocation: %s\n",
                   eina_error_msg_get(err));
    }

    if (!test(0))
    {
        Eina_Error err;

        err = eina_error_get();
        if (err)
            printf("Error during test function: %s\n",
                   eina_error_msg_get(err));
    }

    if (!test(-1))
    {
        Eina_Error err;

        err = eina_error_get();
        if (err)
            printf("Error during test function: %s\n",
                   eina_error_msg_get(err));
    }

    eina_shutdown();

    return EXIT_SUCCESS;
}
static void
_efl_io_buffered_stream_error(void *data, const Efl_Event *event)
{
   Eo *o = data;
   Eina_Error *perr = event->info;
   DBG("%p %s error: %s", o, efl_name_get(event->object), eina_error_msg_get(*perr));
   efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_ERROR, event->info);
}
void error_cb(void *data, const Efl_Event *ev)
{
   Efl_Future_Event_Failure *failure = ev->info;
   const char *msg = eina_error_msg_get(failure->error);
   Efl_Io_Manager *job = data;
   (void) job;

   EINA_LOG_ERR("error: %s", msg);

   ecore_main_loop_quit();
}
示例#4
0
Eina_Bool
azy_content_deserialize_json(Azy_Content *content,
                             const char *buf,
                             ssize_t len  EINA_UNUSED)
{
   cJSON *object;

   EINA_SAFETY_ON_NULL_RETURN_VAL(buf, EINA_FALSE);
   EINA_SAFETY_ON_NULL_RETURN_VAL(content, EINA_FALSE);

   if (!(object = cJSON_Parse(buf)))
     {
        ERR("%s", eina_error_msg_get(AZY_ERROR_REQUEST_JSON_OBJECT));
        return EINA_FALSE;
     }

   content->retval = azy_value_deserialize_json(object);
   cJSON_Delete(object);
   return EINA_TRUE;
}
示例#5
0
static void _efl_egueb_document_io_image_async_cb(Enesim_Buffer *b, void *data,
		Eina_Bool success, Eina_Error error)
{
	Egueb_Dom_Event *ev = data;
	Egueb_Dom_Node *n;
	Enesim_Surface *src = NULL;

	n = EGUEB_DOM_NODE(egueb_dom_event_target_get(ev));
	if (!b)
	{
		ERR("Can not load image, error: %s", eina_error_msg_get(error));
	}
	else
	{
		DBG("Image loaded correctly");
		src = enesim_surface_new_buffer_from(b);
	}

	egueb_dom_event_io_image_finish(ev, src);
	egueb_dom_node_unref(n);
}
示例#6
0
bool InjectedBundle::initialize(const WebProcessCreationParameters&, API::Object* initializationUserData)
{
    m_platformBundle = eina_module_new(m_path.utf8().data());
    if (!m_platformBundle) {
        EINA_LOG_CRIT("Error loading the injected bundle: eina_module_new() failed");
        return false;
    }
    if (!eina_module_load(m_platformBundle)) {
        EINA_LOG_CRIT("Error loading the injected bundle from %s: %s", m_path.utf8().data(), eina_error_msg_get(eina_error_get()));
        eina_module_free(m_platformBundle);
        m_platformBundle = 0;
        return false;
    }

    WKBundleInitializeFunctionPtr initializeFunction = reinterpret_cast<WKBundleInitializeFunctionPtr>(eina_module_symbol_get(m_platformBundle, "WKBundleInitialize"));
    if (!initializeFunction) {
        EINA_LOG_CRIT("Error loading WKBundleInitialize symbol from injected bundle.");
        return false;
    }

    initializeFunction(toAPI(this), toAPI(initializationUserData));
    return true;
}