AC_FUNC_ALLOCA
-AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
-AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
-
-AC_CHECK_HEADERS_ONCE(netinet/in.h sys/mman.h windows.h winsock2.h)
-
-winsock_libs=""
+win32_libs=""
create_shared_lib=""
case "$host_os" in
mingw|mingw32)
- winsock_libs="-lwsock32"
+ PKG_CHECK_MODULES([EVIL], [evil])
+ AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
+ win32_libs="-lws2_32"
create_shared_lib="-no-undefined "
;;
esac
-
-AC_SUBST(winsock_libs)
+AC_SUBST(win32_libs)
AC_SUBST(create_shared_lib)
+AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
+AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
+
+AC_CHECK_HEADERS(netinet/in.h)
+
AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file]))
fnmatch_libs=""
#ifdef EAPI
#undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
+#ifdef _WIN32
+# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI __declspec(dllimport)
# endif
+# define EAPI_DEF
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# else
# define EAPI
# endif
+# define EAPI_DEF EAPI
#endif
#ifdef __cplusplus
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
#endif
#include <zlib.h>
-I$(top_srcdir)/src/lib \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
--DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\"
+-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
+@EVIL_CFLAGS@
lib_LTLIBRARIES = libeet.la
include_HEADERS = Eet.h
eet_utils.c \
Eet_private.h
-libeet_la_LIBADD = -lz -ljpeg @fnmatch_libs@ @winsock_libs@ -lm
+libeet_la_LIBADD = @EVIL_LIBS@ -lz -ljpeg @fnmatch_libs@ @win32_libs@ -lm
libeet_la_DEPENDENCIES = $(top_builddir)/config.h
libeet_la_LDFLAGS = @create_shared_lib@ -version-info @version_info@
/*---*/
-EAPI Eet_Data_Descriptor *
+EAPI_DEF Eet_Data_Descriptor *
eet_data_descriptor_new(const char *name,
int size,
void *(*func_list_next) (void *l),
}
/* new replcement */
-EAPI Eet_Data_Descriptor *
+EAPI_DEF Eet_Data_Descriptor *
eet_data_descriptor2_new(Eet_Data_Descriptor_Class *eddc)
{
Eet_Data_Descriptor *edd;
return edd;
}
-EAPI Eet_Data_Descriptor *
+EAPI_DEF Eet_Data_Descriptor *
eet_data_descriptor3_new(Eet_Data_Descriptor_Class *eddc)
{
Eet_Data_Descriptor *edd;
return edd;
}
-EAPI void
+EAPI_DEF void
eet_data_descriptor_free(Eet_Data_Descriptor *edd)
{
_eet_descriptor_hash_free(edd);
free(edd);
}
-EAPI void
+EAPI_DEF void
eet_data_descriptor_element_add(Eet_Data_Descriptor *edd,
const char *name, int type,
int group_type,
ede->subtype = subtype;
}
-EAPI void *
+EAPI_DEF void *
eet_data_read(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name)
{
const Eet_Dictionary *ed = NULL;
return data_dec;
}
-EAPI int
+EAPI_DEF int
eet_data_write(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const void *data, int compress)
{
Eet_Dictionary *ed;
return NULL;
}
-EAPI int
+EAPI_DEF int
eet_data_text_dump(const void *data_in,
int size_in,
void (*dumpfunc) (void *data, const char *str),
return 0;
}
-EAPI void *
+EAPI_DEF void *
eet_data_text_undump(const char *text,
int textlen,
int *size_ret)
return _eet_data_dump_parse(NULL, size_ret, text, textlen);
}
-EAPI void *
+EAPI_DEF void *
eet_data_descriptor_decode(Eet_Data_Descriptor *edd,
const void *data_in,
int size_in)
return cdata;
}
-EAPI void *
+EAPI_DEF void *
eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
const void *data_in,
int *size_ret)
return d;
}
-EAPI int
+EAPI_DEF int
eet_data_image_write(Eet_File *ef, const char *name,
const void *data, unsigned int w, unsigned int h, int alpha,
int compress, int quality, int lossy)
return 0;
}
-EAPI void *
+EAPI_DEF void *
eet_data_image_read(Eet_File *ef, const char *name,
unsigned int *w, unsigned int *h, int *alpha,
int *compress, int *quality, int *lossy)
return d;
}
-EAPI int
+EAPI_DEF int
eet_data_image_header_read(Eet_File *ef, const char *name,
unsigned int *w, unsigned int *h, int *alpha,
int *compress, int *quality, int *lossy)
return d;
}
-EAPI void *
+EAPI_DEF void *
eet_data_image_encode(const void *data, int *size_ret, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy)
{
void *d = NULL;
return d;
}
-EAPI int
+EAPI_DEF int
eet_data_image_header_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy)
{
int header[8];
return 0;
}
-EAPI void *
+EAPI_DEF void *
eet_data_image_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy)
{
unsigned int *d = NULL;
#include "Eet_private.h"
#include <sys/types.h>
-#ifdef HAVE_SYS_MMAN_H
-# include <sys/mman.h>
-#endif
+#include <sys/mman.h>
#ifdef HAVE_REALPATH
#undef HAVE_REALPATH
return EET_ERROR_WRITE_ERROR;
}
-EAPI int
+EAPI_DEF int
eet_init(void)
{
return ++eet_initcount;
}
-EAPI int
+EAPI_DEF int
eet_shutdown(void)
{
if (--eet_initcount == 0)
return eet_initcount;
}
-EAPI void
+EAPI_DEF void
eet_clearcache(void)
{
int num = 0;
return NULL;
}
-EAPI Eet_File *
+EAPI_DEF Eet_File *
eet_memopen_read(const void *data, size_t size)
{
Eet_File *ef;
return eet_internal_read(ef);
}
-EAPI Eet_File *
+EAPI_DEF Eet_File *
eet_open(const char *file, Eet_File_Mode mode)
{
FILE *fp;
Eet_File *ef;
struct stat file_stat;
-#ifdef _WIN32
- HANDLE h;
-#endif
-
if (!file)
return NULL;
if (eet_test_close(!ef->fp, ef))
return NULL;
-#ifndef _WIN32
fcntl(fileno(ef->fp), F_SETFD, FD_CLOEXEC);
-#else
- /* FIXME: check if that code is needed / correct */
- h = (HANDLE) _get_osfhandle(fileno(ef->fp));
- if (h == INVALID_HANDLE_VALUE)
- return NULL;
- if (!SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0))
- return NULL;
-#endif
/* if we opened for read or read-write */
if ((mode == EET_FILE_MODE_READ) || (mode == EET_FILE_MODE_READ_WRITE))
{
-#ifdef _WIN32
- HANDLE fm;
-#endif
-
-
ef->data_size = file_stat.st_size;
-#ifndef _WIN32
ef->data = mmap(NULL, ef->data_size, PROT_READ,
MAP_SHARED, fileno(ef->fp), 0);
-#else
- fm = CreateFileMapping((HANDLE) _get_osfhandle (fileno(ef->fp)),
- NULL,
- PAGE_READONLY,
- 0,
- 0,
- NULL);
- ef->data = MapViewOfFile(fm,
- FILE_MAP_READ,
- 0,
- 0,
- ef->data_size);
- CloseHandle(fm);
-#endif
ef = eet_internal_read(ef);
if (!ef)
return ef;
}
-EAPI Eet_File_Mode
+EAPI_DEF Eet_File_Mode
eet_mode_get(Eet_File *ef)
{
/* check to see its' an eet file pointer */
return ef->mode;
}
-EAPI Eet_Error
+EAPI_DEF Eet_Error
eet_close(Eet_File *ef)
{
Eet_Error err;
eet_dictionary_free(ef->ed);
-#ifndef _WIN32
if (ef->data) munmap((void*)ef->data, ef->data_size);
-#else
- if (ef->data) UnmapViewOfFile (ef->data);
-#endif
if (ef->fp) fclose(ef->fp);
return err;
}
-EAPI void *
+EAPI_DEF void *
eet_read(Eet_File *ef, const char *name, int *size_ret)
{
void *data = NULL;
return data;
}
-EAPI const void *
+EAPI_DEF const void *
eet_read_direct(Eet_File *ef, const char *name, int *size_ret)
{
const void *data = NULL;
return data;
}
-EAPI int
+EAPI_DEF int
eet_write(Eet_File *ef, const char *name, const void *data, int size, int compress)
{
Eet_File_Node *efn;
return data_size;
}
-EAPI int
+EAPI_DEF int
eet_delete(Eet_File *ef, const char *name)
{
Eet_File_Node *efn;
return exists_already;
}
-EAPI Eet_Dictionary*
+EAPI_DEF Eet_Dictionary*
eet_dictionary_get(Eet_File *ef)
{
if (eet_check_pointer(ef)) return NULL;
}
-EAPI char **
+EAPI_DEF char **
eet_list(Eet_File *ef, const char *glob, int *count_ret)
{
Eet_File_Node *efn;
return list_ret;
}
-EAPI int
+EAPI_DEF int
eet_num_entries(Eet_File *ef)
{
int i, num, ret = 0;