Mercurial > hg > octave-kai > gnulib-hg
annotate lib/mbswidth.h @ 3836:3add19ae3d2c
*** empty log message ***
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Tue, 30 Apr 2002 09:18:24 +0000 (2002-04-30) |
parents | 55d1cb769050 |
children | 55eb3920b607 |
rev | line source |
---|---|
2757 | 1 /* Determine the number of screen columns needed for a string. |
3176
1057602c3299
(mbswidth): Also define as macro, to avoid prototype clash.
Jim Meyering <jim@meyering.net>
parents:
2798
diff
changeset
|
2 Copyright (C) 2000-2001 Free Software Foundation, Inc. |
2757 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software Foundation, | |
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
17 | |
18 #ifndef PARAMS | |
3325
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
19 # if defined (__GNUC__) || __STDC__ |
2757 | 20 # define PARAMS(Args) Args |
21 # else | |
22 # define PARAMS(Args) () | |
23 # endif | |
24 #endif | |
25 | |
2778
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
26 /* Optional flags to influence mbswidth/mbsnwidth behavior. */ |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
27 |
3325
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
28 /* If this bit is set, return -1 upon finding an invalid or incomplete |
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
29 character. Otherwise, assume invalid characters have width 1. */ |
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
30 #define MBSW_REJECT_INVALID 1 |
2778
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
31 |
3325
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
32 /* If this bit is set, return -1 upon finding a non-printable character. |
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
33 Otherwise, assume unprintable characters have width 0 if they are |
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
34 control characters and 1 otherwise. */ |
55d1cb769050
(MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
Jim Meyering <jim@meyering.net>
parents:
3176
diff
changeset
|
35 #define MBSW_REJECT_UNPRINTABLE 2 |
2778
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
36 |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
37 /* Returns the number of screen columns needed for STRING. */ |
3176
1057602c3299
(mbswidth): Also define as macro, to avoid prototype clash.
Jim Meyering <jim@meyering.net>
parents:
2798
diff
changeset
|
38 #define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */ |
2778
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
39 extern int mbswidth PARAMS ((const char *string, int flags)); |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
40 |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
41 /* Returns the number of screen columns needed for the NBYTES bytes |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
42 starting at BUF. */ |
ae01c32493fb
(mbswidth): Add a flags argument.
Jim Meyering <jim@meyering.net>
parents:
2757
diff
changeset
|
43 extern int mbsnwidth PARAMS ((const char *buf, size_t nbytes, int flags)); |