Don't export extra stuff

This commit is contained in:
Matthias Clasen 2005-08-07 13:32:27 +00:00
parent feb7a7ef31
commit c1eead8dad
4 changed files with 39 additions and 33 deletions

View File

@ -1,3 +1,8 @@
2005-08-07 Matthias Clasen <mclasen@redhat.com>
* Rename caches to _caches, so it doesn't
get exported. Also don't export n_caches.
2005-08-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.5 ===

View File

@ -56,8 +56,9 @@ static XdgAliasList *alias_list = NULL;
static XdgParentList *parent_list = NULL;
static XdgDirTimeList *dir_time_list = NULL;
static XdgCallbackList *callback_list = NULL;
XdgMimeCache **caches = NULL;
int n_caches = 0;
XdgMimeCache **_caches = NULL;
static int n_caches = 0;
const char *xdg_mime_type_unknown = "application/octet-stream";
@ -140,8 +141,9 @@ xdg_mime_init_from_directory (const char *directory)
list->next = dir_time_list;
dir_time_list = list;
caches = realloc (caches, sizeof (XdgMimeCache *) * (n_caches + 1));
caches[n_caches] = cache;
_caches = realloc (_caches, sizeof (XdgMimeCache *) * (n_caches + 2));
_caches[n_caches] = cache;
_caches[n_caches + 1] = NULL;
n_caches++;
return FALSE;
@ -433,7 +435,7 @@ xdg_mime_get_mime_type_for_data (const void *data,
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_get_mime_type_for_data (data, len);
mime_type = _xdg_mime_magic_lookup_data (global_magic, data, len);
@ -462,7 +464,7 @@ xdg_mime_get_mime_type_for_file (const char *file_name)
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_get_mime_type_for_file (file_name);
base_name = _xdg_get_base_name (file_name);
@ -518,7 +520,7 @@ xdg_mime_get_mime_type_from_file_name (const char *file_name)
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_get_mime_type_from_file_name (file_name);
mime_type = _xdg_glob_hash_lookup_file_name (global_hash, file_name);
@ -582,7 +584,7 @@ xdg_mime_get_max_buffer_extents (void)
{
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_get_max_buffer_extents ();
return _xdg_mime_magic_get_buffer_extents (global_magic);
@ -595,7 +597,7 @@ xdg_mime_unalias_mime_type (const char *mime_type)
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_unalias_mime_type (mime_type);
if ((lookup = _xdg_mime_alias_list_lookup (alias_list, mime_type)) != NULL)
@ -663,7 +665,7 @@ xdg_mime_mime_type_subclass (const char *mime,
xdg_mime_init ();
if (caches)
if (_caches)
return _xdg_mime_cache_mime_type_subclass (mime, base);
umime = xdg_mime_unalias_mime_type (mime);
@ -707,7 +709,7 @@ xdg_mime_list_mime_parents (const char *mime)
char **result;
int i, n;
if (caches)
if (_caches)
return _xdg_mime_cache_list_mime_parents (mime);
parents = xdg_mime_get_mime_parents (mime);

View File

@ -72,9 +72,6 @@
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
extern XdgMimeCache **caches;
extern int n_caches;
struct _XdgMimeCache
{
int ref_count;
@ -296,9 +293,9 @@ cache_alias_lookup (const char *alias)
const char *ptr;
int i, min, max, mid, cmp;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 4 );
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
xdg_uint32_t offset;
@ -334,9 +331,9 @@ cache_glob_lookup_literal (const char *file_name)
const char *ptr;
int i, min, max, mid, cmp;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 12);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
xdg_uint32_t offset;
@ -374,9 +371,9 @@ cache_glob_lookup_fnmatch (const char *file_name)
int i, j;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 20);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
@ -460,9 +457,9 @@ cache_glob_lookup_suffix (const char *suffix,
int i;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 16);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
@ -484,9 +481,9 @@ find_stopchars (char *stopchars)
int i, j, k, l;
k = 0;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 16);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
@ -558,9 +555,9 @@ _xdg_mime_cache_get_max_buffer_extents (void)
int i;
max_extent = 0;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
offset = GET_UINT32 (cache->buffer, 24);
max_extent = MAX (max_extent, GET_UINT32 (cache->buffer, offset + 4));
@ -578,9 +575,9 @@ _xdg_mime_cache_get_mime_type_for_data (const void *data,
priority = 0;
mime_type = NULL;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
int prio;
const char *match;
@ -720,10 +717,10 @@ _xdg_mime_cache_mime_type_subclass (const char *mime,
if (strcmp (ubase, "application/octet-stream") == 0)
return 1;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 8);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);
@ -782,9 +779,9 @@ _xdg_mime_cache_list_mime_parents (const char *mime)
char **result;
p = 0;
for (i = 0; i < n_caches; i++)
for (i = 0; _caches[i]; i++)
{
XdgMimeCache *cache = caches[i];
XdgMimeCache *cache = _caches[i];
xdg_uint32_t list_offset = GET_UINT32 (cache->buffer, 8);
xdg_uint32_t n_entries = GET_UINT32 (cache->buffer, list_offset);

View File

@ -37,6 +37,8 @@ typedef struct _XdgMimeCache XdgMimeCache;
#define _xdg_mime_cache_unref XDG_ENTRY(cache_unref)
#endif
extern XdgMimeCache **_caches;
XdgMimeCache *_xdg_mime_cache_new_from_file (const char *file_name);
XdgMimeCache *_xdg_mime_cache_ref (XdgMimeCache *cache);
void _xdg_mime_cache_unref (XdgMimeCache *cache);