Subversion Repositories Scribus

Rev

Rev 9672 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
3 paul 7
/* LibHnj is dual licensed under LGPL and MPL. Boilerplate for both
8
 * licenses follows.
9
 */
10
 
11
/* LibHnj - a library for high quality hyphenation and justification
12
 * Copyright (C) 1998 Raph Levien, (C) 2001 ALTLinux, Moscow
13
 *
14
 * This library is free software; you can redistribute it and/or
15
 * modify it under the terms of the GNU Library General Public
16
 * License as published by the Free Software Foundation; either
17
 * version 2 of the License, or (at your option) any later version.
18
 *
19
 * This library is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22
 * Library General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU Library General Public
25
 * License along with this library; if not, write to the
18122 mrdocs 26
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27
 * Boston, MA  02110-1301  USA.
3 paul 28
*/
29
 
30
/*
31
 * The contents of this file are subject to the Mozilla Public License
32
 * Version 1.0 (the "MPL"); you may not use this file except in
33
 * compliance with the MPL.  You may obtain a copy of the MPL at
34
 * http://www.mozilla.org/MPL/
35
 *
36
 * Software distributed under the MPL is distributed on an "AS IS" basis,
37
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
38
 * for the specific language governing rights and limitations under the
39
 * MPL.
40
 *
41
 */
42
#ifndef __HYPHEN_H__
43
#define __HYPHEN_H__
44
 
45
#ifdef __cplusplus
46
extern "C" {
47
#endif /* __cplusplus */
48
 
49
typedef struct _HyphenDict HyphenDict;
50
typedef struct _HyphenState HyphenState;
51
typedef struct _HyphenTrans HyphenTrans;
52
#define MAX_CHARS 256
53
#define MAX_NAME 20
54
 
55
struct _HyphenDict {
56
  int num_states;
57
  char cset[MAX_NAME];
58
  HyphenState *states;
59
};
60
 
61
struct _HyphenState {
62
  char *match;
63
  int fallback_state;
64
  int num_trans;
65
  HyphenTrans *trans;
66
};
67
 
68
struct _HyphenTrans {
69
  char ch;
70
  int new_state;
71
};
72
 
73
HyphenDict *hnj_hyphen_load (const char *fn);
74
void hnj_hyphen_free (HyphenDict *dict);
75
int hnj_hyphen_hyphenate (HyphenDict *dict,
76
                           const char *word, int word_size,
77
                           char *hyphens);
78
 
79
#ifdef __cplusplus
80
}
81
#endif /* __cplusplus */
82
 
83
#endif /* __HYPHEN_H__ */