first.
SVN revision: 83867
* Functions that affect Evas as a whole.
*/
+/**
+ * Get the path for the cserve binary to execute
+ *
+ * There is little need for anyone except a desktop nevironment to call this.
+ * This can be called before evas_init() has been called. It will try and find
+ * the full path to the to the cserve binary to run to provide cserve image
+ * and font caching services for evas.
+ *
+ * @return NULL if error, or a string with the full path to the cserve binary.
+ *
+ * @since 1.8
+ */
+EAPI const char *evas_cserve_path_get(void);
+
/**
* Initialize Evas
*
remote.sun_family = AF_UNIX;
_socket_path_set(remote.sun_path);
len = strlen(remote.sun_path) + sizeof(remote.sun_family);
- if (connect(s, (struct sockaddr *)&remote, len) == -1)
+ for (;;)
{
- ERR("connect");
- close(s);
- return EINA_FALSE;
+ if (connect(s, (struct sockaddr *)&remote, len) != -1) break;
+ ERR("cserve connect failed. retrying.");
+ usleep(1000);
}
fcntl(s, F_SETFL, O_NONBLOCK);
if (!pfx) return NULL;
return eina_prefix_lib_get(pfx);
}
+
+EAPI const char *
+evas_cserve_path_get(void)
+{
+ static char buf[PATH_MAX];
+ const char *lib;
+ Eina_Bool shutdown = EINA_FALSE;
+
+ if (!pfx)
+ {
+ shutdown = EINA_TRUE;
+ eina_init();
+ pfx = eina_prefix_new
+ (NULL, _evas_module_libdir_get, "EVAS", "evas", "checkme",
+ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
+ PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
+ if (!pfx)
+ {
+ eina_shutdown();
+ return NULL;
+ }
+ }
+ lib = eina_prefix_lib_get(pfx);
+ if (!lib)
+ {
+ if (shutdown)
+ {
+ eina_prefix_free(pfx);
+ pfx = NULL;
+ eina_shutdown();
+ }
+ return NULL;
+ }
+ snprintf(buf, sizeof(buf), "%s/evas/cserve2/bin/%s/evas_cserve2",
+ lib, MODULE_ARCH);
+ if (shutdown)
+ {
+ eina_prefix_free(pfx);
+ pfx = NULL;
+ eina_shutdown();
+ }
+ return buf;
+}