2
LibGViewer - GTK+ File Viewer library
3
Copyright (C) 2006 Assaf Gordon
6
GNOME Commander - A GNOME based file manager
7
Copyright (C) 2001-2006 Marcus Bjurman
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2 of the License, or
12
(at your option) any later version.
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#ifndef __LIBGVIEWER_TYPES_H__
24
#define __LIBGVIEWER_TYPES_H__
26
/* TODO: Change these for Big-Endian machines */
28
#define is_displayable(c) (((c) >= 0x20) && ((c) < 0x7f))
30
#define GV_FIRST_BYTE(x) ((unsigned char)(x)&0xFF)
31
#define GV_SECOND_BYTE(x) ((unsigned char)((x)>>8)&0xFF)
32
#define GV_THIRD_BYTE(x) ((unsigned char)((x)>>16)&0xFF)
33
#define GV_FOURTH_BYTE(x) ((unsigned char)((x)>>24)&0xFF)
37
UTF-8 encoding supports up to 6 (six) bytes per single character.
38
We use only 32bits (4 bytes) to hold a UTF-8 data.
39
This means some exotic UTF-8 characters are NOT supported...
41
typedef guint32 char_type ;
42
#define INVALID_CHAR ((char_type) -1)
45
Currently on files<2GB are supported (even though this is unsigned)
47
typedef unsigned long offset_type;
48
#define INVALID_OFFSET ((offset_type) -1)