~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to pith/charset.h

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: charset.h 341 2006-12-21 23:44:18Z hubert@u.washington.edu $
 
3
 *
 
4
 * ========================================================================
 
5
 * Copyright 2006 University of Washington
 
6
 *
 
7
 * Licensed under the Apache License, Version 2.0 (the "License");
 
8
 * you may not use this file except in compliance with the License.
 
9
 * You may obtain a copy of the License at
 
10
 *
 
11
 *     http://www.apache.org/licenses/LICENSE-2.0
 
12
 *
 
13
 * ========================================================================
 
14
 */
 
15
 
 
16
#ifndef PITH_CHARSET_INCLUDED
 
17
#define PITH_CHARSET_INCLUDED
 
18
 
 
19
 
 
20
#include "../pith/filttype.h"
 
21
 
 
22
 
 
23
typedef struct conversion_table {
 
24
    char          *from_charset;
 
25
    char          *to_charset;
 
26
    int            quality;
 
27
    void          *table;
 
28
    filter_t       convert;
 
29
} CONV_TABLE;
 
30
 
 
31
 
 
32
/* Conversion table quality of tranlation */
 
33
#define CV_NO_TRANSLATE_POSSIBLE        1       /* We don't know how to      */
 
34
                                                /* translate this pair       */
 
35
#define CV_NO_TRANSLATE_NEEDED          2       /* Not necessary, no-op      */
 
36
#define CV_LOSES_SPECIAL_CHARS          3       /* Letters will translate    */
 
37
                                                /* ok but some special chars */
 
38
                                                /* may be lost               */
 
39
#define CV_LOSES_SOME_LETTERS           4       /* Some special chars and    */
 
40
                                                /* some letters may be lost  */
 
41
 
 
42
 
 
43
#define CSET_MAX                64
 
44
 
 
45
 
 
46
/* exported protoypes */
 
47
int            utf8able(char *);
 
48
char          *body_charset(MAILSTREAM *, long, unsigned char *);
 
49
unsigned char *trans_euc_to_2022_jp(unsigned char *);
 
50
unsigned char *rfc1522_decode(unsigned char *, size_t, char *, char **);
 
51
char          *rfc1522_encode(char *, size_t, unsigned char *, char *);
 
52
CONV_TABLE    *conversion_table(char *, char *);
 
53
void           decode_addr_names_to_utf8(ADDRESS *);
 
54
void           convert_possibly_encoded_str_to_utf8(char **);
 
55
 
 
56
 
 
57
#endif /* PITH_CHARSET_INCLUDED */