Back to index

libcitadel  8.12
Classes | Typedefs | Enumerations | Functions | Variables
xdgmime.c File Reference
#include "xdgmime.h"
#include "xdgmimeint.h"
#include "xdgmimeglob.h"
#include "xdgmimemagic.h"
#include "xdgmimealias.h"
#include "xdgmimeparent.h"
#include "xdgmimecache.h"
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <assert.h>

Go to the source code of this file.

Classes

struct  XdgDirTimeList
struct  XdgCallbackList

Typedefs

typedef struct XdgDirTimeList
typedef struct XdgCallbackList
typedef int(* XdgDirectoryFunc )(const char *directory, void *user_data)

Enumerations

enum  { XDG_CHECKED_UNCHECKED, XDG_CHECKED_VALID, XDG_CHECKED_INVALID }

Functions

static XdgDirTimeListxdg_dir_time_list_new (void)
static void xdg_dir_time_list_free (XdgDirTimeList *list)
static int xdg_mime_init_from_directory (const char *directory)
static void xdg_run_command_on_dirs (XdgDirectoryFunc func, void *user_data)
static XdgMimeCache * xdg_lookup_cache_for_file (const char *file_path)
static int xdg_check_file (const char *file_path)
static int xdg_check_dir (const char *directory, int *invalid_dir_list)
static int xdg_check_dirs (void)
static int xdg_check_time_and_dirs (void)
static void xdg_mime_init (void)
const char * xdg_mime_get_mime_type_for_data (const void *data, size_t len)
const char * xdg_mime_get_mime_type_for_file (const char *file_name, struct stat *statbuf)
const char * xdg_mime_get_mime_type_from_file_name (const char *file_name)
int xdg_mime_is_valid_mime_type (const char *mime_type)
void xdg_mime_shutdown (void)
int xdg_mime_get_max_buffer_extents (void)
static const char * _xdg_mime_unalias_mime_type (const char *mime_type)
const char * xdg_mime_unalias_mime_type (const char *mime_type)
int _xdg_mime_mime_type_equal (const char *mime_a, const char *mime_b)
int xdg_mime_mime_type_equal (const char *mime_a, const char *mime_b)
int _xdg_mime_media_type_equal (const char *mime_a, const char *mime_b)
int xdg_mime_media_type_equal (const char *mime_a, const char *mime_b)
int _xdg_mime_mime_type_subclass (const char *mime, const char *base)
int xdg_mime_mime_type_subclass (const char *mime, const char *base)
char ** xdg_mime_list_mime_parents (const char *mime)
const char ** xdg_mime_get_mime_parents (const char *mime)
void xdg_mime_dump (void)
int xdg_mime_register_reload_callback (XdgMimeCallback callback, void *data, XdgMimeDestroy destroy)
void xdg_mime_remove_callback (int callback_id)

Variables

static int need_reread = TRUE
static time_t last_stat_time = 0
static XdgGlobHashglobal_hash = NULL
static XdgMimeMagicglobal_magic = NULL
static XdgAliasListalias_list = NULL
static XdgParentListparent_list = NULL
static XdgDirTimeListdir_time_list = NULL
static XdgCallbackListcallback_list = NULL
XdgMimeCache ** _xdg_mime_caches = NULL
static int n_caches = 0
const char xdg_mime_type_unknown [] = "application/octet-stream"

Class Documentation

struct XdgDirTimeList

Definition at line 73 of file xdgmime.c.

Collaboration diagram for XdgDirTimeList:
Class Members
XdgMimeCache * cache
int checked
char * directory_name
time_t mtime
XdgDirTimeList * next
struct XdgCallbackList

Definition at line 82 of file xdgmime.c.

Collaboration diagram for XdgCallbackList:
Class Members
XdgMimeCallback callback
int callback_id
void * data
XdgMimeDestroy destroy
XdgCallbackList * next
XdgCallbackList * prev

Typedef Documentation

typedef struct XdgCallbackList

Definition at line 48 of file xdgmime.c.

typedef int(* XdgDirectoryFunc)(const char *directory, void *user_data)

Definition at line 94 of file xdgmime.c.

typedef struct XdgDirTimeList

Definition at line 47 of file xdgmime.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
XDG_CHECKED_UNCHECKED 
XDG_CHECKED_VALID 
XDG_CHECKED_INVALID 

Definition at line 66 of file xdgmime.c.


Function Documentation

int _xdg_mime_media_type_equal ( const char *  mime_a,
const char *  mime_b 
)

Definition at line 680 of file xdgmime.c.

{
  char *sep;

  xdg_mime_init ();

  sep = strchr (mime_a, '/');
  
  if (sep && strncmp (mime_a, mime_b, sep - mime_a + 1) == 0)
    return 1;

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _xdg_mime_mime_type_equal ( const char *  mime_a,
const char *  mime_b 
)

Definition at line 656 of file xdgmime.c.

{
  const char *unalias_a, *unalias_b;

  unalias_a = _xdg_mime_unalias_mime_type (mime_a);
  unalias_b = _xdg_mime_unalias_mime_type (mime_b);

  if (strcmp (unalias_a, unalias_b) == 0)
    return 1;

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _xdg_mime_mime_type_subclass ( const char *  mime,
const char *  base 
)

Definition at line 722 of file xdgmime.c.

{
  const char *umime, *ubase;
  const char **parents;

  if (_xdg_mime_caches)
    return _xdg_mime_cache_mime_type_subclass (mime, base);

  umime = _xdg_mime_unalias_mime_type (mime);
  ubase = _xdg_mime_unalias_mime_type (base);

  if (strcmp (umime, ubase) == 0)
    return 1;

#if 0  
  /* Handle supertypes */
  if (xdg_mime_is_super_type (ubase) &&
      _xdg_mime_media_type_equal (umime, ubase))
    return 1;
#endif

  /*  Handle special cases text/plain and application/octet-stream */
  if (strcmp (ubase, "text/plain") == 0 && 
      strncmp (umime, "text/", 5) == 0)
    return 1;

  if (strcmp (ubase, "application/octet-stream") == 0)
    return 1;
  
  parents = _xdg_mime_parent_list_lookup (parent_list, umime);
  for (; parents && *parents; parents++)
    {
      if (_xdg_mime_mime_type_subclass (*parents, ubase))
       return 1;
    }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* _xdg_mime_unalias_mime_type ( const char *  mime_type) [static]

Definition at line 634 of file xdgmime.c.

{
  const char *lookup;

  if (_xdg_mime_caches)
    return _xdg_mime_cache_unalias_mime_type (mime_type);

  if ((lookup = _xdg_mime_alias_list_lookup (alias_list, mime_type)) != NULL)
    return lookup;

  return mime_type;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int xdg_check_dir ( const char *  directory,
int *  invalid_dir_list 
) [static]

Definition at line 327 of file xdgmime.c.

{
  int invalid, has_cache;
  char *file_name;

  assert (directory != NULL);

  /* Check the mime.cache file */
  file_name = malloc (strlen (directory) + strlen ("/mime/mime.cache") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/mime.cache");
  invalid = xdg_check_file (file_name);
  has_cache = xdg_lookup_cache_for_file (file_name) != NULL;
  free (file_name);

  if (has_cache)
    {
      if (invalid)
       {
         *invalid_dir_list = TRUE;
         return TRUE;
       }

      return FALSE;
    }

  /* Check the globs file */
  file_name = malloc (strlen (directory) + strlen ("/mime/globs") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/globs");
  invalid = xdg_check_file (file_name);
  free (file_name);
  if (invalid)
    {
      *invalid_dir_list = TRUE;
      return TRUE;
    }

  /* Check the magic file */
  file_name = malloc (strlen (directory) + strlen ("/mime/magic") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/magic");
  invalid = xdg_check_file (file_name);
  free (file_name);
  if (invalid)
    {
      *invalid_dir_list = TRUE;
      return TRUE;
    }

  return FALSE; /* Keep processing */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int xdg_check_dirs ( void  ) [static]

Definition at line 381 of file xdgmime.c.

{
  XdgDirTimeList *list;
  int invalid_dir_list = FALSE;

  for (list = dir_time_list; list; list = list->next)
    list->checked = XDG_CHECKED_UNCHECKED;

  xdg_run_command_on_dirs ((XdgDirectoryFunc) xdg_check_dir,
                        &invalid_dir_list);

  if (invalid_dir_list)
    return TRUE;

  for (list = dir_time_list; list; list = list->next)
    {
      if (list->checked != XDG_CHECKED_VALID)
       return TRUE;
    }

  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int xdg_check_file ( const char *  file_path) [static]

Definition at line 298 of file xdgmime.c.

{
  struct stat st;

  /* If the file exists */
  if (stat (file_path, &st) == 0)
    {
      XdgDirTimeList *list;

      for (list = dir_time_list; list; list = list->next)
       {
         if (! strcmp (list->directory_name, file_path) &&
             st.st_mtime == list->mtime)
           {
             if (list->checked == XDG_CHECKED_UNCHECKED)
              list->checked = XDG_CHECKED_VALID;
             else if (list->checked == XDG_CHECKED_VALID)
              list->checked = XDG_CHECKED_INVALID;

             return (list->checked != XDG_CHECKED_VALID);
           }
       }
      return TRUE;
    }

  return FALSE;
}

Here is the caller graph for this function:

static int xdg_check_time_and_dirs ( void  ) [static]

Definition at line 409 of file xdgmime.c.

{
  struct timeval tv;
  time_t current_time;
  int retval = FALSE;

  gettimeofday (&tv, NULL);
  current_time = tv.tv_sec;

  if (current_time >= last_stat_time + 5)
    {
      retval = xdg_check_dirs ();
      last_stat_time = current_time;
    }

  return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void xdg_dir_time_list_free ( XdgDirTimeList list) [static]

Definition at line 109 of file xdgmime.c.

{
  XdgDirTimeList *next;

  while (list)
    {
      next = list->next;
      free (list->directory_name);
      free (list);
      list = next;
    }
}

Here is the caller graph for this function:

static XdgDirTimeList* xdg_dir_time_list_new ( void  ) [static]

Definition at line 98 of file xdgmime.c.

{
  XdgDirTimeList *retval;

  retval = calloc (1, sizeof (XdgDirTimeList));
  retval->checked = XDG_CHECKED_UNCHECKED;

  return retval;
}

Here is the caller graph for this function:

static XdgMimeCache* xdg_lookup_cache_for_file ( const char *  file_path) [static]

Definition at line 280 of file xdgmime.c.

{
  XdgDirTimeList *list;

  for (list = dir_time_list; list; list = list->next)
      if (! strcmp (list->directory_name, file_path))
        return list->cache;

  return NULL;
}

Here is the caller graph for this function:

void xdg_mime_dump ( void  )

Definition at line 808 of file xdgmime.c.

{
  printf ("*** ALIASES ***\n\n");
  _xdg_mime_alias_list_dump (alias_list);
  printf ("\n*** PARENTS ***\n\n");
  _xdg_mime_parent_list_dump (parent_list);
  printf ("\n*** CACHE ***\n\n");
  _xdg_glob_hash_dump (global_hash);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 623 of file xdgmime.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const char** xdg_mime_get_mime_parents ( const char *  mime)

Definition at line 796 of file xdgmime.c.

{
  const char *umime;

  xdg_mime_init ();

  umime = _xdg_mime_unalias_mime_type (mime);

  return _xdg_mime_parent_list_lookup (parent_list, umime);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* xdg_mime_get_mime_type_for_data ( const void *  data,
size_t  len 
)

Definition at line 452 of file xdgmime.c.

{
  const char *mime_type;

  xdg_mime_init ();

  if (_xdg_mime_caches)
    return _xdg_mime_cache_get_mime_type_for_data (data, len);

  mime_type = _xdg_mime_magic_lookup_data (global_magic, data, len, NULL, 0);

  if (mime_type)
    return mime_type;

  return XDG_MIME_TYPE_UNKNOWN;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* xdg_mime_get_mime_type_for_file ( const char *  file_name,
struct stat *  statbuf 
)

Definition at line 471 of file xdgmime.c.

{
  const char *mime_type;
  /* Used to detect whether multiple MIME types match file_name */
  const char *mime_types[2];
  FILE *file;
  unsigned char *data;
  int max_extent;
  int bytes_read;
  struct stat buf;
  const char *base_name;
  int n;

  if (file_name == NULL)
    return NULL;
  if (! _xdg_utf8_validate (file_name))
    return NULL;

  xdg_mime_init ();

  if (_xdg_mime_caches)
    return _xdg_mime_cache_get_mime_type_for_file (file_name, statbuf);

  base_name = _xdg_get_base_name (file_name);
  n = _xdg_glob_hash_lookup_file_name (global_hash, base_name, mime_types, 2);

  if (n == 1)
    return mime_types[0];

  if (!statbuf)
    {
      if (stat (file_name, &buf) != 0)
       return XDG_MIME_TYPE_UNKNOWN;

      statbuf = &buf;
    }

  if (!S_ISREG (statbuf->st_mode))
    return XDG_MIME_TYPE_UNKNOWN;

  /* FIXME: Need to make sure that max_extent isn't totally broken.  This could
   * be large and need getting from a stream instead of just reading it all
   * in. */
  max_extent = _xdg_mime_magic_get_buffer_extents (global_magic);
  data = malloc (max_extent);
  if (data == NULL)
    return XDG_MIME_TYPE_UNKNOWN;
        
  file = fopen (file_name, "r");
  if (file == NULL)
    {
      free (data);
      return XDG_MIME_TYPE_UNKNOWN;
    }

  bytes_read = fread (data, 1, max_extent, file);
  if (ferror (file))
    {
      free (data);
      fclose (file);
      return XDG_MIME_TYPE_UNKNOWN;
    }

  mime_type = _xdg_mime_magic_lookup_data (global_magic, data, bytes_read,
                                      mime_types, n);

  free (data);
  fclose (file);

  if (mime_type)
    return mime_type;

  return XDG_MIME_TYPE_UNKNOWN;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* xdg_mime_get_mime_type_from_file_name ( const char *  file_name)

Definition at line 548 of file xdgmime.c.

{
  const char *mime_types[2];

  xdg_mime_init ();

  if (_xdg_mime_caches)
    return _xdg_mime_cache_get_mime_type_from_file_name (file_name);

  if (_xdg_glob_hash_lookup_file_name (global_hash, file_name, mime_types, 2) == 1)
    return mime_types[0];
  else
    return XDG_MIME_TYPE_UNKNOWN;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void xdg_mime_init ( void  ) [static]

Definition at line 430 of file xdgmime.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int xdg_mime_init_from_directory ( const char *  directory) [static]

Definition at line 123 of file xdgmime.c.

{
  char *file_name;
  struct stat st;
  XdgDirTimeList *list;

  assert (directory != NULL);

  file_name = malloc (strlen (directory) + strlen ("/mime/mime.cache") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/mime.cache");
  if (stat (file_name, &st) == 0)
    {
      XdgMimeCache *cache = _xdg_mime_cache_new_from_file (file_name);

      if (cache != NULL)
       {
         list = xdg_dir_time_list_new ();
         list->directory_name = file_name;
         list->mtime = st.st_mtime;
         list->next = dir_time_list;
         list->cache = cache;
         dir_time_list = list;

         _xdg_mime_caches = realloc (_xdg_mime_caches, sizeof (XdgMimeCache *) * (n_caches + 2));
         _xdg_mime_caches[n_caches] = cache;
          _xdg_mime_caches[n_caches + 1] = NULL;
         n_caches++;

         return FALSE;
       }
    }
  free (file_name);

  file_name = malloc (strlen (directory) + strlen ("/mime/globs") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/globs");
  if (stat (file_name, &st) == 0)
    {
      _xdg_mime_glob_read_from_file (global_hash, file_name);

      list = xdg_dir_time_list_new ();
      list->directory_name = file_name;
      list->mtime = st.st_mtime;
      list->next = dir_time_list;
      dir_time_list = list;
    }
  else
    {
      free (file_name);
    }

  file_name = malloc (strlen (directory) + strlen ("/mime/magic") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/magic");
  if (stat (file_name, &st) == 0)
    {
      _xdg_mime_magic_read_from_file (global_magic, file_name);

      list = xdg_dir_time_list_new ();
      list->directory_name = file_name;
      list->mtime = st.st_mtime;
      list->next = dir_time_list;
      dir_time_list = list;
    }
  else
    {
      free (file_name);
    }

  file_name = malloc (strlen (directory) + strlen ("/mime/aliases") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/aliases");
  _xdg_mime_alias_read_from_file (alias_list, file_name);
  free (file_name);

  file_name = malloc (strlen (directory) + strlen ("/mime/subclasses") + 1);
  strcpy (file_name, directory); strcat (file_name, "/mime/subclasses");
  _xdg_mime_parent_read_from_file (parent_list, file_name);
  free (file_name);

  return FALSE; /* Keep processing */
}

Here is the call graph for this function:

Here is the caller graph for this function:

int xdg_mime_is_valid_mime_type ( const char *  mime_type)

Definition at line 564 of file xdgmime.c.

{
  /* FIXME: We should make this a better test
   */
  return _xdg_utf8_validate (mime_type);
}

Here is the call graph for this function:

char** xdg_mime_list_mime_parents ( const char *  mime)

Definition at line 772 of file xdgmime.c.

{
  const char **parents;
  char **result;
  int i, n;

  if (_xdg_mime_caches)
    return _xdg_mime_cache_list_mime_parents (mime);

  parents = xdg_mime_get_mime_parents (mime);

  if (!parents)
    return NULL;

  for (i = 0; parents[i]; i++) ;
  
  n = (i + 1) * sizeof (char *);
  result = (char **) malloc (n);
  memcpy (result, parents, n);

  return result;
}

Here is the call graph for this function:

int xdg_mime_media_type_equal ( const char *  mime_a,
const char *  mime_b 
)

Definition at line 696 of file xdgmime.c.

{
  xdg_mime_init ();

  return _xdg_mime_media_type_equal (mime_a, mime_b);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int xdg_mime_mime_type_equal ( const char *  mime_a,
const char *  mime_b 
)

Definition at line 671 of file xdgmime.c.

{
  xdg_mime_init ();

  return _xdg_mime_mime_type_equal (mime_a, mime_b);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int xdg_mime_mime_type_subclass ( const char *  mime,
const char *  base 
)

Definition at line 763 of file xdgmime.c.

{
  xdg_mime_init ();

  return _xdg_mime_mime_type_subclass (mime, base);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int xdg_mime_register_reload_callback ( XdgMimeCallback  callback,
void *  data,
XdgMimeDestroy  destroy 
)

Definition at line 822 of file xdgmime.c.

{
  XdgCallbackList *list_el;
  static int callback_id = 1;

  /* Make a new list element */
  list_el = calloc (1, sizeof (XdgCallbackList));
  list_el->callback_id = callback_id;
  list_el->callback = callback;
  list_el->data = data;
  list_el->destroy = destroy;
  list_el->next = callback_list;
  if (list_el->next)
    list_el->next->prev = list_el;

  callback_list = list_el;
  callback_id ++;

  return callback_id - 1;
}
void xdg_mime_remove_callback ( int  callback_id)

Definition at line 846 of file xdgmime.c.

{
  XdgCallbackList *list;

  for (list = callback_list; list; list = list->next)
    {
      if (list->callback_id == callback_id)
       {
         if (list->next)
           list->next = list->prev;

         if (list->prev)
           list->prev->next = list->next;
         else
           callback_list = list->next;

         /* invoke the destroy handler */
         (list->destroy) (list->data);
         free (list);
         return;
       }
    }
}
void xdg_mime_shutdown ( void  )

Definition at line 572 of file xdgmime.c.

{
  XdgCallbackList *list;

  /* FIXME: Need to make this (and the whole library) thread safe */
  if (dir_time_list)
    {
      xdg_dir_time_list_free (dir_time_list);
      dir_time_list = NULL;
    }
       
  if (global_hash)
    {
      _xdg_glob_hash_free (global_hash);
      global_hash = NULL;
    }
  if (global_magic)
    {
      _xdg_mime_magic_free (global_magic);
      global_magic = NULL;
    }

  if (alias_list)
    {
      _xdg_mime_alias_list_free (alias_list);
      alias_list = NULL;
    }

  if (parent_list)
    {
      _xdg_mime_parent_list_free (parent_list);
      parent_list = NULL;
    }

  if (_xdg_mime_caches)
    {
      int i;
      for (i = 0; i < n_caches; i++)
        _xdg_mime_cache_unref (_xdg_mime_caches[i]);
      free (_xdg_mime_caches);
      _xdg_mime_caches = NULL;
      n_caches = 0;
    }

  for (list = callback_list; list; list = list->next)
    (list->callback) (list->data);

  need_reread = TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* xdg_mime_unalias_mime_type ( const char *  mime_type)

Definition at line 648 of file xdgmime.c.

{
  xdg_mime_init ();

  return _xdg_mime_unalias_mime_type (mime_type);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void xdg_run_command_on_dirs ( XdgDirectoryFunc  func,
void *  user_data 
) [static]

Definition at line 205 of file xdgmime.c.

{
  const char *xdg_data_home;
  const char *xdg_data_dirs;
  const char *ptr;

  xdg_data_home = getenv ("XDG_DATA_HOME");
  if (xdg_data_home)
    {
      if ((func) (xdg_data_home, user_data))
       return;
    }
  else
    {
      const char *home;

      home = getenv ("HOME");
      if (home != NULL)
       {
         char *guessed_xdg_home;
         int stop_processing;

         guessed_xdg_home = malloc (strlen (home) + strlen ("/.local/share/") + 1);
         strcpy (guessed_xdg_home, home);
         strcat (guessed_xdg_home, "/.local/share/");
         stop_processing = (func) (guessed_xdg_home, user_data);
         free (guessed_xdg_home);

         if (stop_processing)
           return;
       }
    }

  xdg_data_dirs = getenv ("XDG_DATA_DIRS");
  if (xdg_data_dirs == NULL)
    xdg_data_dirs = "/usr/local/share/:/usr/share/";

  ptr = xdg_data_dirs;

  while (*ptr != '\000')
    {
      const char *end_ptr;
      char *dir;
      int len;
      int stop_processing;

      end_ptr = ptr;
      while (*end_ptr != ':' && *end_ptr != '\000')
       end_ptr ++;

      if (end_ptr == ptr)
       {
         ptr++;
         continue;
       }

      if (*end_ptr == ':')
       len = end_ptr - ptr;
      else
       len = end_ptr - ptr + 1;
      dir = malloc (len + 1);
      strncpy (dir, ptr, len);
      dir[len] = '\0';
      stop_processing = (func) (dir, user_data);
      free (dir);

      if (stop_processing)
       return;

      ptr = end_ptr;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

XdgMimeCache** _xdg_mime_caches = NULL

Definition at line 60 of file xdgmime.c.

XdgAliasList* alias_list = NULL [static]

Definition at line 55 of file xdgmime.c.

XdgCallbackList* callback_list = NULL [static]

Definition at line 58 of file xdgmime.c.

XdgDirTimeList* dir_time_list = NULL [static]

Definition at line 57 of file xdgmime.c.

XdgGlobHash* global_hash = NULL [static]

Definition at line 53 of file xdgmime.c.

XdgMimeMagic* global_magic = NULL [static]

Definition at line 54 of file xdgmime.c.

time_t last_stat_time = 0 [static]

Definition at line 51 of file xdgmime.c.

int n_caches = 0 [static]

Definition at line 61 of file xdgmime.c.

int need_reread = TRUE [static]

Definition at line 50 of file xdgmime.c.

XdgParentList* parent_list = NULL [static]

Definition at line 56 of file xdgmime.c.

const char xdg_mime_type_unknown[] = "application/octet-stream"

Definition at line 63 of file xdgmime.c.