Browse Source

major abi changes:

* introduce the mbstate_t typedef.
impacts gnu libiconv, which has already been taken care of.
* Prepare for mb stuff to really exist, replace macro MB_CUR_MAX with
an external variable __mb_cur_max (impacts libX11 and various ports).
* use mbstate in all the mb <-> wchar functions with state.
* add a stub iswctype function allowing some ports to compile.
bash and gdiff are missing wcscoll, and need to be told there's no i18n
until this is fixed.
Discussed and matthieu, otto, millert, kettenis, deraadt.
Major libc bump
OPENBSD_3_8
espie 19 years ago
parent
commit
175c6c79dd
5 changed files with 30 additions and 6 deletions
  1. +6
    -1
      src/include/stddef.h
  2. +3
    -2
      src/include/stdlib.h
  3. +17
    -1
      src/include/wchar.h
  4. +3
    -1
      src/include/wctype.h
  5. +1
    -1
      src/lib/libc/stdlib/Makefile.inc

+ 6
- 1
src/include/stddef.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stddef.h,v 1.7 2005/04/14 20:59:10 espie Exp $ */
/* $OpenBSD: stddef.h,v 1.8 2005/05/11 18:44:12 espie Exp $ */
/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
/*-
@ -57,6 +57,11 @@ typedef _BSD_WINT_T_ wint_t;
#undef _BSD_WINT_T_
#endif
#ifdef _BSD_MBSTATE_T_
typedef _BSD_MBSTATE_T_ mbstate_t;
#undef _BSD_MBSTATE_T_
#endif
#ifndef NULL
#ifdef __GNUG__
#define NULL __null


+ 3
- 2
src/include/stdlib.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stdlib.h,v 1.32 2004/08/03 19:59:42 millert Exp $ */
/* $OpenBSD: stdlib.h,v 1.33 2005/05/11 18:44:12 espie Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@ -84,7 +84,8 @@ typedef struct {
#define RAND_MAX 0x7fffffff
#define MB_CUR_MAX 1 /* XXX */
extern size_t __mb_cur_max;
#define MB_CUR_MAX __mb_cur_max
#include <sys/cdefs.h>


+ 17
- 1
src/include/wchar.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: wchar.h,v 1.1 2005/04/14 20:59:10 espie Exp $ */
/* $OpenBSD: wchar.h,v 1.2 2005/05/11 18:44:12 espie Exp $ */
/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */
/*-
@ -84,6 +84,11 @@ typedef _BSD_WCHAR_T_ wchar_t;
#undef _BSD_WCHAR_T_
#endif
#ifdef _BSD_MBSTATE_T_
typedef _BSD_MBSTATE_T_ mbstate_t;
#undef _BSD_MBSTATE_T_
#endif
#ifdef _BSD_WINT_T_
typedef _BSD_WINT_T_ wint_t;
#undef _BSD_WINT_T_
@ -99,6 +104,14 @@ typedef _BSD_SIZE_T_ size_t;
#endif
__BEGIN_DECLS
wint_t btowc(int);
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);
int mbsinit(const mbstate_t *);
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
mbstate_t * __restrict);
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
wchar_t *wcschr(const wchar_t *, wchar_t);
int wcscmp(const wchar_t *, const wchar_t *);
@ -113,6 +126,8 @@ wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict,
size_t);
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
wchar_t *wcsrchr(const wchar_t *, wchar_t);
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
mbstate_t * __restrict);
size_t wcsspn(const wchar_t *, const wchar_t *);
wchar_t *wcsstr(const wchar_t *, const wchar_t *);
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
@ -128,6 +143,7 @@ wchar_t *wmemset(wchar_t *, wchar_t, size_t);
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
int wctob(wint_t);
__END_DECLS
#endif /* !_WCHAR_H_ */

+ 3
- 1
src/include/wctype.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: wctype.h,v 1.2 2005/04/30 09:14:23 espie Exp $ */
/* $OpenBSD: wctype.h,v 1.3 2005/05/11 18:44:12 espie Exp $ */
/* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */
/*-
@ -69,6 +69,8 @@ int iswupper(wint_t);
int iswxdigit(wint_t);
wint_t towlower(wint_t);
wint_t towupper(wint_t);
int iswctype(wint_t, wctype_t);
wctype_t wctype(const char *);
__END_DECLS
#endif /* _WCTYPE_H_ */

+ 1
- 1
src/lib/libc/stdlib/Makefile.inc View File

@ -6,7 +6,7 @@
SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c atoll.c bsearch.c \
calloc.c cfree.c exit.c ecvt.c gcvt.c getenv.c getopt_long.c \
getsubopt.c hcreate.c heapsort.c l64a.c llabs.c lsearch.c malloc.c \
merge.c multibyte.c putenv.c qsort.c radixsort.c rand.c random.c \
merge.c putenv.c qsort.c radixsort.c rand.c random.c \
realpath.c setenv.c strtod.c strtol.c strtoll.c strtonum.c strtoul.c \
strtoull.c system.c \
tfind.c tsearch.c _rand48.c drand48.c erand48.c jrand48.c lcong48.c \


Loading…
Cancel
Save