2008-03-07 23:28:12 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
2003-02-02 17:07:58 -08:00
|
|
|
#ifndef _EET_PRIVATE_H
|
|
|
|
#define _EET_PRIVATE_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <sys/types.h>
|
2004-07-14 09:37:29 -07:00
|
|
|
#include <sys/stat.h>
|
2003-02-02 17:07:58 -08:00
|
|
|
#include <fcntl.h>
|
2006-05-19 19:44:24 -07:00
|
|
|
#include <errno.h>
|
2007-09-29 02:21:43 -07:00
|
|
|
#ifdef HAVE_ALLOCA_H
|
|
|
|
# include <alloca.h>
|
|
|
|
#elif defined __GNUC__
|
|
|
|
# define alloca __builtin_alloca
|
|
|
|
#elif defined _AIX
|
|
|
|
# define alloca __alloca
|
|
|
|
#elif defined _MSC_VER
|
|
|
|
# include <malloc.h>
|
|
|
|
# define alloca _alloca
|
|
|
|
#else
|
|
|
|
# include <stddef.h>
|
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
# endif
|
|
|
|
void *alloca (size_t);
|
2005-11-03 19:22:22 -08:00
|
|
|
#endif
|
2007-09-14 16:38:17 -07:00
|
|
|
#include <ctype.h>
|
2004-07-14 09:37:29 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
2007-09-25 11:26:49 -07:00
|
|
|
# include <netinet/in.h>
|
2008-01-25 21:50:09 -08:00
|
|
|
#endif
|
2008-03-01 22:49:48 -08:00
|
|
|
|
|
|
|
#ifdef HAVE_EVIL
|
|
|
|
# include <Evil.h>
|
2004-07-14 09:37:29 -07:00
|
|
|
#endif
|
|
|
|
|
2003-02-02 17:07:58 -08:00
|
|
|
#include <zlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fnmatch.h>
|
|
|
|
#include <jpeglib.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <locale.h>
|
|
|
|
|
2006-01-09 23:32:56 -08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
// BROKEN in gcc 4 on amd64
|
|
|
|
//# pragma GCC visibility push(hidden)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2008-02-29 22:38:09 -08:00
|
|
|
typedef struct _Eet_String Eet_String;
|
|
|
|
|
|
|
|
struct _Eet_String
|
|
|
|
{
|
|
|
|
const char *mmap;
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int converted : 1;
|
|
|
|
unsigned int is_float : 1;
|
|
|
|
} flags;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
float f;
|
|
|
|
double d;
|
|
|
|
} convert;
|
|
|
|
|
|
|
|
int hash;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
int next;
|
|
|
|
int prev;
|
|
|
|
};
|
|
|
|
struct _Eet_Dictionary
|
|
|
|
{
|
|
|
|
Eet_String *all;
|
|
|
|
|
|
|
|
int size;
|
|
|
|
int offset;
|
|
|
|
|
|
|
|
int hash[256];
|
|
|
|
|
|
|
|
int count;
|
|
|
|
int total;
|
2008-03-06 09:52:59 -08:00
|
|
|
|
|
|
|
const char *start;
|
|
|
|
const char *end;
|
2008-02-29 22:38:09 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
Eet_Dictionary *eet_dictionary_add(void);
|
|
|
|
void eet_dictionary_free(Eet_Dictionary *ed);
|
|
|
|
int eet_dictionary_string_add(Eet_Dictionary *ed, const char *string);
|
|
|
|
int eet_dictionary_string_get_size(const Eet_Dictionary *ed, int index);
|
|
|
|
const char *eet_dictionary_string_get_char(const Eet_Dictionary *ed, int index);
|
|
|
|
int eet_dictionary_string_get_float(const Eet_Dictionary *ed, int index, float *result);
|
|
|
|
int eet_dictionary_string_get_double(const Eet_Dictionary *ed, int index, double *result);
|
|
|
|
|
2006-03-03 18:46:24 -08:00
|
|
|
FILE *_eet_memfile_read_open(const void *data, size_t size);
|
2003-02-02 17:07:58 -08:00
|
|
|
void _eet_memfile_read_close(FILE *f);
|
|
|
|
FILE *_eet_memfile_write_open(void **data, size_t *size);
|
|
|
|
void _eet_memfile_write_close(FILE *f);
|
2006-11-05 04:14:08 -08:00
|
|
|
void _eet_memfile_shutdown(void);
|
2006-12-28 07:23:47 -08:00
|
|
|
int _eet_hash_gen(const char *key, int hash_size);
|
2007-09-25 11:26:49 -07:00
|
|
|
int _eet_string_to_double_convert(const char *src, long long *m, long *e);
|
|
|
|
void _eet_double_to_string_convert(char *des, double d);
|
2003-07-10 03:32:27 -07:00
|
|
|
|
|
|
|
#ifndef PATH_MAX
|
2005-05-25 20:57:57 -07:00
|
|
|
#define PATH_MAX 4096
|
2003-07-10 03:32:27 -07:00
|
|
|
#endif
|
|
|
|
|
2003-02-02 17:07:58 -08:00
|
|
|
#endif
|