Implement window size passing between real tty and virtual console.
[dragonfly/vkernel-mp.git] / contrib / tar / lib / unicodeio.h
blob4a22bfbb88c253ea524de760b17d7e10b551d427
1 /* Unicode character output to streams with locale dependent encoding.
3 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 #ifndef UNICODEIO_H
20 # define UNICODEIO_H
22 # include <stdio.h>
24 # ifndef PARAMS
25 # if defined PROTOTYPES || (defined __STDC__ && __STDC__)
26 # define PARAMS(Args) Args
27 # else
28 # define PARAMS(Args) ()
29 # endif
30 # endif
32 /* Converts the Unicode character CODE to its multibyte representation
33 in the current locale and calls the CALLBACK on the resulting byte
34 sequence. If an error occurs, invokes ERROR_CALLBACK instead,
35 passing it CODE with errno set appropriately. Returns whatever the
36 callback returns. */
37 extern int unicode_to_mb
38 PARAMS ((unsigned int code,
39 int (*callback) PARAMS ((const char *buf, size_t buflen,
40 void *callback_arg)),
41 int (*error_callback) PARAMS ((unsigned int code,
42 void * callback_arg)),
43 void *callback_arg));
45 /* Success callback that outputs the conversion of the character. */
46 extern int print_unicode_success PARAMS((const char *buf, size_t buflen,
47 void *callback_arg));
49 /* Failure callback that outputs an ASCII representation. */
50 extern int print_unicode_failure PARAMS((unsigned int code,
51 void *callback_arg));
53 /* Outputs the Unicode character CODE to the output stream STREAM.
54 Returns -1 (setting errno) if unsuccessful. */
55 extern int print_unicode_char PARAMS((FILE *stream, unsigned int code));
57 #endif