expose the encode and decode string functions for the benefit of history

and readline.
This commit is contained in:
christos 2009-12-31 18:32:37 +00:00
parent 8cfe483422
commit 4168f34493
2 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: chartype.c,v 1.1 2009/12/30 22:37:40 christos Exp $ */
/* $NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: chartype.c,v 1.1 2009/12/30 22:37:40 christos Exp $");
__RCSID("$NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $");
#endif /* not lint && not SCCSID */
#include "el.h"
#include <stdlib.h>
@ -75,7 +75,7 @@ ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize)
}
protected char *
public char *
ct_encode_string(const Char *s, ct_buffer_t *conv)
{
char *dst;
@ -115,7 +115,7 @@ ct_encode_string(const Char *s, ct_buffer_t *conv)
return conv->cbuff;
}
protected Char *
public Char *
ct_decode_string(const char *s, ct_buffer_t *conv)
{
size_t len = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: chartype.h,v 1.2 2009/12/30 23:54:52 christos Exp $ */
/* $NetBSD: chartype.h,v 1.3 2009/12/31 18:32:37 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -171,11 +171,13 @@ typedef struct ct_buffer_t {
size_t wsize;
} ct_buffer_t;
#define ct_encode_string __ct_encode_string
/* Encode a wide character string and return the UTF-8 encoded result. */
protected char *ct_encode_string(const Char *, ct_buffer_t *);
public char *ct_encode_string(const Char *, ct_buffer_t *);
#define ct_decode_string __ct_decode_string
/* Decode a (multi)?byte string and return the wide character string result. */
protected Char *ct_decode_string(const char *, ct_buffer_t *);
public Char *ct_decode_string(const char *, ct_buffer_t *);
/* Decode a (multi)?byte argv string array.
* The pointer returned must be free()d when done. */