/** * @internal * @return Returns > 0 on success or 0 on failure * @brief Initialize the Desktop parser subsystem */ int efreet_desktop_init(void) { _efreet_desktop_log_dom = eina_log_domain_register ("efreet_desktop", EFREET_DEFAULT_LOG_COLOR); if (_efreet_desktop_log_dom < 0) { EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_desktop"); return 0; } #ifdef HAVE_EVIL if (!evil_sockets_init()) { ERR("Could not initialize Winsock system"); return 0; } #endif efreet_desktop_types = NULL; EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application", efreet_desktop_application_fields_parse, efreet_desktop_application_fields_save, NULL); EFREET_DESKTOP_TYPE_LINK = efreet_desktop_type_add("Link", efreet_desktop_link_fields_parse, efreet_desktop_link_fields_save, NULL); EFREET_DESKTOP_TYPE_DIRECTORY = efreet_desktop_type_add("Directory", NULL, NULL, NULL); efreet_desktop_changes_listen(); return 1; }
int evil_init(void) { SYSTEMTIME st; LARGE_INTEGER freq; LARGE_INTEGER count; WORD second = 59; if (++_evil_init_count != 1) return _evil_init_count; { DWORD v; v = GetVersion(); if (!v || ((DWORD)(LOBYTE(LOWORD(v))) < 6)) { fprintf(stderr, "Windows XP not supported anymore, exiting.\n"); return 0; } } if (!QueryPerformanceFrequency(&freq)) return 0; _evil_time_freq = freq.QuadPart; /* be sure that second + 1 != 0 */ while (second == 59) { GetSystemTime(&st); second = st.wSecond; } /* retrieve the tick corresponding to the time we retrieve above */ while (1) { GetSystemTime(&st); QueryPerformanceCounter(&count); if (st.wSecond == second + 1) break; } _evil_time_second = _evil_systemtime_to_time(st); if (_evil_time_second < 0) return --_evil_init_count; _evil_time_count = count.QuadPart; if (!evil_sockets_init()) return --_evil_init_count; return _evil_init_count; }