forked from enlightenment/efl
Everything is working except the file monitors to look for new/modified files. This is going up in hopes that someone can find the bug in my code pertaining to this as I haven't been able to.
If you find the bug and fix it, don't hesitate to commit the code :) Have Fun\! SVN revision: 30515
This commit is contained in:
parent
0c4af24a33
commit
fe2842a58f
|
@ -9,4 +9,4 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
|
|||
bin_SCRIPTS = efreet-config
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = efreet.pc
|
||||
pkgconfig_DATA = efreet.pc efreet-mime.pc
|
||||
|
|
|
@ -65,6 +65,7 @@ AC_SUBST(requirements)
|
|||
AC_OUTPUT([
|
||||
efreet-config
|
||||
efreet.pc
|
||||
efreet-mime.pc
|
||||
Makefile
|
||||
src/Makefile
|
||||
src/lib/Makefile
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: efreet-mime
|
||||
Description: Freedesktop Shared Mime Info standard implementation for the EFL
|
||||
Requires: @requirements@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lefreet_mime
|
||||
Cflags: -I${includedir}/efreet
|
|
@ -6,8 +6,11 @@ INCLUDES = \
|
|||
|
||||
bin_PROGRAMS = efreet_test efreet_spec_test efreet_cache_test
|
||||
|
||||
efreet_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet.la
|
||||
efreet_test_LDADD = $(top_builddir)/src/lib/libefreet.la @ECORE_LIBS@
|
||||
efreet_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet.la \
|
||||
$(top_builddir)/src/lib/libefreet_mime.la
|
||||
efreet_test_LDADD = $(top_builddir)/src/lib/libefreet.la \
|
||||
$(top_builddir)/src/lib/libefreet_mime.la \
|
||||
@ECORE_LIBS@
|
||||
efreet_test_SOURCES = \
|
||||
ef_data_dirs.c \
|
||||
ef_icon_theme.c \
|
||||
|
@ -16,6 +19,7 @@ ef_locale.c \
|
|||
ef_desktop.c \
|
||||
ef_menu.c \
|
||||
ef_utils.c \
|
||||
ef_mime.c \
|
||||
main.c
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* vim: set sw=4 ts=4 sts=4 et: */
|
||||
#include "Efreet.h"
|
||||
#include "Efreet_Mime.h"
|
||||
#include "efreet_private.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
double calc_time(const struct timeval* start, const struct timeval* end)
|
||||
{
|
||||
double s,e;
|
||||
|
||||
s = ((double)start->tv_sec)+((double)start->tv_usec/1000000.0);
|
||||
e = ((double)end->tv_sec)+((double)end->tv_usec/1000000.0);
|
||||
|
||||
return e-s;
|
||||
}
|
||||
|
||||
int ef_mime_cb_get(void)
|
||||
{
|
||||
Efreet_Mime_Method flags = EFREET_MIME_FLAG_GLOB;
|
||||
const char *mime = NULL;
|
||||
int misses = 0, i = 0;
|
||||
const char* files[3] = {PACKAGE_DATA_DIR"/efreet/test/test_type.desktop",
|
||||
PACKAGE_DATA_DIR"/efreet/test/test_type.desktop",
|
||||
PACKAGE_DATA_DIR"/efreet/test/sub"
|
||||
};
|
||||
|
||||
|
||||
if(!efreet_mime_init())
|
||||
{
|
||||
printf("Could not init efreet\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for(i=0; i < 3; ++i)
|
||||
{
|
||||
mime = efreet_mime_get(files[i], flags);
|
||||
|
||||
if(!mime)
|
||||
misses++;
|
||||
|
||||
flags <<= 1;
|
||||
}
|
||||
|
||||
efreet_mime_shutdown();
|
||||
|
||||
return !misses;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
/* vim: set sw=4 ts=4 sts=4 et: */
|
||||
#include "Efreet.h"
|
||||
#include "Efreet_Mime.h"
|
||||
#include <Ecore.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -30,6 +31,7 @@ int ef_cb_menu_edit(void);
|
|||
#endif
|
||||
int ef_cb_ini_long_line(void);
|
||||
int ef_cb_utils(void);
|
||||
int ef_mime_cb_get(void);
|
||||
|
||||
typedef struct Efreet_Test Efreet_Test;
|
||||
struct Efreet_Test
|
||||
|
@ -64,6 +66,7 @@ static Efreet_Test tests[] = {
|
|||
{"Menu Edit", ef_cb_menu_edit},
|
||||
#endif
|
||||
{"Utils", ef_cb_utils},
|
||||
{"Mime", ef_mime_cb_get},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/* vim: set sw=4 ts=4 sts=4 et: */
|
||||
#ifndef EFREET_MIME_H
|
||||
#define EFREET_MIME_H
|
||||
|
||||
/**
|
||||
* @file Efreet_Mime.h
|
||||
* @brief The file that must be included by any project wishing to use
|
||||
* Efreet_Mime. Efreet_Mime.h provides all of the necessary headers and
|
||||
* includes to work with Efreet_Mime.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @mainpage The Efreet Mime Library
|
||||
*
|
||||
* @section intro Introduction
|
||||
*
|
||||
* Efreet Mime is a library designed to help apps work with the
|
||||
* Freedesktop.org Shared Mime Info standard.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum Efreet_Mime_Method
|
||||
{
|
||||
EFREET_MIME_FLAG_GLOB=1,
|
||||
EFREET_MIME_FLAG_MAGIC=2,
|
||||
EFREET_MIME_FLAG_TYPES=4
|
||||
} Efreet_Mime_Method;
|
||||
|
||||
int efreet_mime_init(void);
|
||||
void efreet_mime_shutdown(void);
|
||||
const char *efreet_mime_get(const char *file, int flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -7,7 +7,7 @@ INCLUDES = \
|
|||
-g -O0 -W -Wall \
|
||||
@ECORE_CFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libefreet.la
|
||||
lib_LTLIBRARIES = libefreet.la libefreet_mime.la
|
||||
|
||||
EFREETHEADERS = \
|
||||
Efreet.h \
|
||||
|
@ -16,7 +16,7 @@ efreet_desktop.h \
|
|||
efreet_icon.h \
|
||||
efreet_ini.h \
|
||||
efreet_menu.h \
|
||||
efreet_utils.h
|
||||
efreet_utils.h
|
||||
|
||||
EFREETSOURCES = \
|
||||
efreet.c \
|
||||
|
@ -34,8 +34,17 @@ $(EFREETHEADERS)
|
|||
libefreet_la_SOURCES = \
|
||||
$(EFREETSOURCES)
|
||||
|
||||
EFREETMIMEHEADERS = \
|
||||
Efreet_Mime.h
|
||||
|
||||
EFREETMIMESOURCES = \
|
||||
efreet_mime.c
|
||||
|
||||
libefreet_mime_la_SOURCES = \
|
||||
$(EFREETMIMESOURCES)
|
||||
|
||||
installed_headersdir = $(prefix)/include/efreet
|
||||
installed_headers_DATA = $(EFREETHEADERS)
|
||||
installed_headers_DATA = $(EFREETHEADERS) $(EFREETMIMEHEADERS)
|
||||
|
||||
libefreet_la_LIBADD = @ECORE_LIBS@
|
||||
libefreet_la_LDFLAGS = -version-info 1:0:0
|
||||
|
|
|
@ -29,7 +29,7 @@ efreet_base_init(void)
|
|||
/**
|
||||
* @internal
|
||||
* @return Returns no value
|
||||
* @brief Cleans up the efree base settings system
|
||||
* @brief Cleans up the efreet base settings system
|
||||
*/
|
||||
void
|
||||
efreet_base_shutdown(void)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue