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: 30515devs/devilhorns/wayland_egl
parent
0c4af24a33
commit
fe2842a58f
10 changed files with 1308 additions and 7 deletions
@ -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 |
@ -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; |
||||
} |
@ -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 |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue