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
|
|
|
|
|
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-10-26 00:05:11 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
2008-09-08 02:19:57 -07:00
|
|
|
|
2008-02-29 22:38:09 -08:00
|
|
|
typedef struct _Eet_String Eet_String;
|
|
|
|
|
|
|
|
struct _Eet_String
|
|
|
|
{
|
|
|
|
const char *mmap;
|
|
|
|
char *str;
|
|
|
|
|
2008-03-09 09:16:40 -07:00
|
|
|
int hash;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
int next;
|
|
|
|
int prev;
|
|
|
|
|
2008-02-29 22:38:09 -08:00
|
|
|
union
|
|
|
|
{
|
|
|
|
float f;
|
|
|
|
double d;
|
|
|
|
} convert;
|
|
|
|
|
2008-03-09 09:16:40 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int converted : 1;
|
|
|
|
unsigned int is_float : 1;
|
|
|
|
} flags;
|
2008-02-29 22:38:09 -08:00
|
|
|
};
|
|
|
|
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);
|
2008-07-17 13:28:59 -07:00
|
|
|
int eet_dictionary_string_get_hash(const Eet_Dictionary *ed, int index);
|
2008-02-29 22:38:09 -08:00
|
|
|
|
2006-12-28 07:23:47 -08:00
|
|
|
int _eet_hash_gen(const char *key, int hash_size);
|
2003-07-10 03:32:27 -07:00
|
|
|
|
2008-09-08 02:19:57 -07:00
|
|
|
const void* eet_identity_check(const void *data_base, unsigned int data_length,
|
2009-04-16 05:15:56 -07:00
|
|
|
void **sha1, int *sha1_length,
|
2008-09-08 02:19:57 -07:00
|
|
|
const void *signature_base, unsigned int signature_length,
|
2008-11-26 02:45:47 -08:00
|
|
|
const void **raw_signature_base, unsigned int *raw_signature_length,
|
2008-09-08 02:19:57 -07:00
|
|
|
int *x509_length);
|
2009-02-09 05:53:20 -08:00
|
|
|
void *eet_identity_compute_sha1(const void *data_base, unsigned int data_length,
|
|
|
|
int *sha1_length);
|
2008-11-13 08:31:13 -08:00
|
|
|
Eet_Error eet_cipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
|
|
|
|
Eet_Error eet_decipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
|
2008-09-08 02:19:57 -07:00
|
|
|
Eet_Error eet_identity_sign(FILE *fp, Eet_Key *key);
|
|
|
|
void eet_identity_unref(Eet_Key *key);
|
|
|
|
void eet_identity_ref(Eet_Key *key);
|
|
|
|
|
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
|
|
|
|
|
2008-06-26 08:47:25 -07:00
|
|
|
#ifdef DNDEBUG
|
|
|
|
#define EET_ASSERT(Test, Do) if (Test == 0) Do;
|
|
|
|
#else
|
|
|
|
#define EET_ASSERT(Test, Do) if (Test == 0) abort();
|
|
|
|
#endif
|
|
|
|
|
2003-02-02 17:07:58 -08:00
|
|
|
#endif
|