Back to index

libcitadel  8.12
Defines | Typedefs | Functions | Variables
xdgmimeint.h File Reference
#include "xdgmime.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define FALSE   (0)
#define TRUE   (!FALSE)
#define SWAP_BE16_TO_LE16(val)   (xdg_uint16_t)(((xdg_uint16_t)(val) << 8)|((xdg_uint16_t)(val) >> 8))
#define SWAP_BE32_TO_LE32(val)
#define _xdg_utf8_next_char(p)   (char *)((p) + _xdg_utf8_skip[*(unsigned char *)(p)])
#define _xdg_utf8_char_size(p)   (int) (_xdg_utf8_skip[*(unsigned char *)(p)])

Typedefs

typedef unsigned int xdg_unichar_t
typedef unsigned char xdg_uchar8_t
typedef unsigned short xdg_uint16_t
typedef unsigned int xdg_uint32_t

Functions

xdg_unichar_t _xdg_utf8_to_ucs4 (const char *source)
xdg_unichar_t _xdg_ucs4_to_lower (xdg_unichar_t source)
int _xdg_utf8_validate (const char *source)
const char * _xdg_get_base_name (const char *file_name)

Variables

const char *const _xdg_utf8_skip

Define Documentation

#define _xdg_utf8_char_size (   p)    (int) (_xdg_utf8_skip[*(unsigned char *)(p)])

Definition at line 66 of file xdgmimeint.h.

#define _xdg_utf8_next_char (   p)    (char *)((p) + _xdg_utf8_skip[*(unsigned char *)(p)])

Definition at line 65 of file xdgmimeint.h.

#define FALSE   (0)

Definition at line 35 of file xdgmimeint.h.

#define SWAP_BE16_TO_LE16 (   val)    (xdg_uint16_t)(((xdg_uint16_t)(val) << 8)|((xdg_uint16_t)(val) >> 8))

Definition at line 56 of file xdgmimeint.h.

#define SWAP_BE32_TO_LE32 (   val)
Value:
(xdg_uint32_t)((((xdg_uint32_t)(val) & 0xFF000000U) >> 24) |   \
                                         (((xdg_uint32_t)(val) & 0x00FF0000U) >> 8) |      \
                                         (((xdg_uint32_t)(val) & 0x0000FF00U) << 8) |      \
                                         (((xdg_uint32_t)(val) & 0x000000FFU) << 24))

Definition at line 58 of file xdgmimeint.h.

#define TRUE   (!FALSE)

Definition at line 39 of file xdgmimeint.h.


Typedef Documentation

typedef unsigned char xdg_uchar8_t

Definition at line 44 of file xdgmimeint.h.

typedef unsigned short xdg_uint16_t

Definition at line 45 of file xdgmimeint.h.

typedef unsigned int xdg_uint32_t

Definition at line 46 of file xdgmimeint.h.

typedef unsigned int xdg_unichar_t

Definition at line 43 of file xdgmimeint.h.


Function Documentation

const char* _xdg_get_base_name ( const char *  file_name)

Definition at line 141 of file xdgmimeint.c.

{
  const char *base_name;

  if (file_name == NULL)
    return NULL;

  base_name = strrchr (file_name, '/');

  if (base_name == NULL)
    return file_name;
  else
    return base_name + 1;
}

Here is the caller graph for this function:

Definition at line 124 of file xdgmimeint.c.

{
  /* FIXME: Do a real to_upper sometime */
  /* CaseFolding-3.2.0.txt has a table of rules. */
  if ((source & 0xFF) == source)
    return (xdg_unichar_t) tolower ((unsigned char) source);
  return source;
}

Here is the caller graph for this function:

xdg_unichar_t _xdg_utf8_to_ucs4 ( const char *  source)

Definition at line 61 of file xdgmimeint.c.

{
  xdg_unichar_t ucs32;
  if( ! ( *source & 0x80 ) )
    {
      ucs32 = *source;
    }
  else
    {
      int bytelength = 0;
      xdg_unichar_t result;
      if ( ! (*source & 0x40) )
       {
         ucs32 = *source;
       }
      else
       {
         if ( ! (*source & 0x20) )
           {
             result = *source++ & 0x1F;
             bytelength = 2;
           }
         else if ( ! (*source & 0x10) )
           {
             result = *source++ & 0x0F;
             bytelength = 3;
           }
         else if ( ! (*source & 0x08) )
           {
             result = *source++ & 0x07;
             bytelength = 4;
           }
         else if ( ! (*source & 0x04) )
           {
             result = *source++ & 0x03;
             bytelength = 5;
           }
         else if ( ! (*source & 0x02) )
           {
             result = *source++ & 0x01;
             bytelength = 6;
           }
         else
           {
             result = *source++;
             bytelength = 1;
           }

         for ( bytelength --; bytelength > 0; bytelength -- )
           {
             result <<= 6;
             result |= *source++ & 0x3F;
           }
         ucs32 = result;
       }
    }
  return ucs32;
}

Here is the caller graph for this function:

int _xdg_utf8_validate ( const char *  source)

Definition at line 134 of file xdgmimeint.c.

{
  /* FIXME: actually write */
  return TRUE;
}

Here is the caller graph for this function:


Variable Documentation

const char* const _xdg_utf8_skip

Definition at line 55 of file xdgmimeint.c.