~ubuntu-branches/ubuntu/karmic/leafpad/karmic

« back to all changes in this revision

Viewing changes to src/encoding.h

  • Committer: Bazaar Package Importer
  • Author(s): Benedikt Meurer
  • Date: 2005-01-02 17:30:21 UTC
  • Revision ID: james.westby@ubuntu.com-20050102173021-dw22pfb1drduleb2
Tags: upstream-0.7.9
ImportĀ upstreamĀ versionĀ 0.7.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  encoding.h
 
3
 *  This file is part of Leafpad
 
4
 *
 
5
 *  Copyright (C) 2004 Tarot Osuji
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 */
 
21
 
 
22
#ifndef _ENCODING_H
 
23
#define _ENCODING_H
 
24
 
 
25
//#define ENCODING_MAX_ITEM_NUM 3
 
26
 
 
27
enum {
 
28
        IANA = 0,
 
29
        OPENI18N,
 
30
        CODEPAGE,
 
31
        ENCODING_MAX_ITEM_NUM
 
32
};
 
33
 
 
34
typedef struct {
 
35
        const gchar *item[ENCODING_MAX_ITEM_NUM];
 
36
} EncArray;
 
37
 
 
38
enum {
 
39
        LF = 0x0A,
 
40
        CR = 0x0D,
 
41
};
 
42
 
 
43
guint get_encoding_code(void);
 
44
EncArray *get_encoding_items(guint code);
 
45
const gchar *get_default_charset(void);
 
46
gint detect_line_ending(const gchar *text);
 
47
void convert_line_ending_to_lf(gchar *text);
 
48
void convert_line_ending(gchar **text, gint retcode);
 
49
const gchar *detect_charset(const gchar *text);
 
50
 
 
51
#endif  /* _ENCODING_H */