| 1 | /* lb.h -- Line breaking | 
|---|
| 2 | Copyright (c) 1993-1995 Eberhard Mattes | 
|---|
| 3 |  | 
|---|
| 4 | This file is part of emxdoc. | 
|---|
| 5 |  | 
|---|
| 6 | emxdoc is free software; you can redistribute it and/or modify it | 
|---|
| 7 | under the terms of the GNU General Public License as published by | 
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 9 | any later version. | 
|---|
| 10 |  | 
|---|
| 11 | emxdoc is distributed in the hope that it will be useful, | 
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 14 | GNU General Public License for more details. | 
|---|
| 15 |  | 
|---|
| 16 | You should have received a copy of the GNU General Public License | 
|---|
| 17 | along with emxdoc; see the file COPYING.  If not, write to | 
|---|
| 18 | the Free Software Foundation, 59 Temple Place - Suite 330, | 
|---|
| 19 | Boston, MA 02111-1307, USA.  */ | 
|---|
| 20 |  | 
|---|
| 21 |  | 
|---|
| 22 | #define LB_NOMEM        1 | 
|---|
| 23 | #define LB_INVAL        2 | 
|---|
| 24 | #define LB_INTERN       3 | 
|---|
| 25 |  | 
|---|
| 26 | #define LBN_WORD        1 | 
|---|
| 27 | #define LBN_PRE         2 | 
|---|
| 28 | #define LBN_POST        3 | 
|---|
| 29 | #define LBN_GLUE        4 | 
|---|
| 30 | #define LBN_NEWLINE     5 | 
|---|
| 31 | #define LBN_END         6 | 
|---|
| 32 |  | 
|---|
| 33 | #define LB_INFINITY             10000 | 
|---|
| 34 | #define LB_SQRT_INFINITY        100 | 
|---|
| 35 |  | 
|---|
| 36 | #define LB_HYPHEN       '*' | 
|---|
| 37 |  | 
|---|
| 38 | struct lb; | 
|---|
| 39 | struct lbh; | 
|---|
| 40 |  | 
|---|
| 41 | struct lb_node | 
|---|
| 42 | { | 
|---|
| 43 | int type; | 
|---|
| 44 | int value; | 
|---|
| 45 | const char *word; | 
|---|
| 46 | const void *info; | 
|---|
| 47 | }; | 
|---|
| 48 |  | 
|---|
| 49 | int lb_init (struct lb **pp, int lmargin, int rmargin); | 
|---|
| 50 | int lb_exit (struct lb **p); | 
|---|
| 51 | int lb_first_lmargin (struct lb *p, int margin); | 
|---|
| 52 | int lb_first_rmargin (struct lb *p, int margin); | 
|---|
| 53 | int lb_penalty (struct lb *p, int penalty); | 
|---|
| 54 | int lb_word (struct lb *p, int width, const char *word, const void *info); | 
|---|
| 55 | int lb_discr (struct lb *p, int width_word, const char *word, | 
|---|
| 56 | int width_pre, const char *pre, int width_post, const char *post, | 
|---|
| 57 | const void *info); | 
|---|
| 58 | int lb_hyphen (struct lb *p, int width, const void *info); | 
|---|
| 59 | int lb_glue (struct lb *p, int width, const void *info); | 
|---|
| 60 | int lb_format (struct lb *p); | 
|---|
| 61 | int lb_next (struct lb *p, struct lb_node *dst); | 
|---|
| 62 |  | 
|---|
| 63 | int lb_use_hyphenation (struct lb *p, const struct lbh *h); | 
|---|
| 64 |  | 
|---|
| 65 | int lbh_init (struct lbh **pp); | 
|---|
| 66 | int lbh_word (struct lbh *p, const char *s); | 
|---|
| 67 | int lbh_exit (struct lbh **pp); | 
|---|