Make the format of LC_CTYPE files architecture independent by
introducing the disk formats for _RuneLocale and friends. The disk formats do not have (useless) pointers and have 32-bit quantities instead of rune_t and long. (htonl(3) only works with 32-bit quantities, so there's no loss). Bootstrap mklocale(1) when necessary. (Bootstrapping from 4.x would be trivial (verified), but we no longer provide pre-5.3 source upgrades and this is the first commit to actually break it.)
This commit is contained in:
parent
14c8d90def
commit
3fb3a43079
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142582
@ -768,6 +768,10 @@ _cap_mkdb= usr.bin/cap_mkdb
|
|||||||
_lex= usr.bin/lex
|
_lex= usr.bin/lex
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if ${BOOTSTRAPPING} < 600016
|
||||||
|
_mklocale= usr.bin/mklocale
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${BOOTSTRAPPING} < 450005 || \
|
.if ${BOOTSTRAPPING} < 450005 || \
|
||||||
${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500034
|
${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500034
|
||||||
_uudecode= usr.bin/uudecode
|
_uudecode= usr.bin/uudecode
|
||||||
@ -807,6 +811,7 @@ bootstrap-tools:
|
|||||||
${_lex} \
|
${_lex} \
|
||||||
usr.bin/lorder \
|
usr.bin/lorder \
|
||||||
usr.bin/makewhatis \
|
usr.bin/makewhatis \
|
||||||
|
${_mklocale} \
|
||||||
usr.bin/rpcgen \
|
usr.bin/rpcgen \
|
||||||
${_uudecode} \
|
${_uudecode} \
|
||||||
${_xargs} \
|
${_xargs} \
|
||||||
|
@ -15,7 +15,8 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
|
|||||||
netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
|
netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
|
||||||
proc_service.h pthread.h \
|
proc_service.h pthread.h \
|
||||||
pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
|
pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
|
||||||
resolv.h runetype.h search.h setjmp.h sgtty.h signal.h stab.h \
|
resolv.h runefile.h runetype.h search.h setjmp.h sgtty.h \
|
||||||
|
signal.h stab.h \
|
||||||
stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
|
stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
|
||||||
strings.h sysexits.h tar.h tgmath.h \
|
strings.h sysexits.h tar.h tgmath.h \
|
||||||
time.h timeconv.h timers.h ttyent.h \
|
time.h timeconv.h timers.h ttyent.h \
|
||||||
|
61
include/runefile.h
Normal file
61
include/runefile.h
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (c) 2005 Ruslan Ermilov
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _RUNEFILE_H_
|
||||||
|
#define _RUNEFILE_H_
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef _CACHED_RUNES
|
||||||
|
#define _CACHED_RUNES (1 << 8)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int32_t min;
|
||||||
|
int32_t max;
|
||||||
|
int32_t map;
|
||||||
|
} _FileRuneEntry;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char magic[8];
|
||||||
|
char encoding[32];
|
||||||
|
|
||||||
|
uint32_t runetype[_CACHED_RUNES];
|
||||||
|
int32_t maplower[_CACHED_RUNES];
|
||||||
|
int32_t mapupper[_CACHED_RUNES];
|
||||||
|
|
||||||
|
int32_t runetype_ext_nranges;
|
||||||
|
int32_t maplower_ext_nranges;
|
||||||
|
int32_t mapupper_ext_nranges;
|
||||||
|
|
||||||
|
int32_t variable_len;
|
||||||
|
} _FileRuneLocale;
|
||||||
|
|
||||||
|
#define _FILE_RUNE_MAGIC_1 "RuneMag1"
|
||||||
|
|
||||||
|
#endif /* !_RUNEFILE_H_ */
|
@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <runetype.h>
|
#include <runetype.h>
|
||||||
|
#include <runefile.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -51,149 +52,238 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|
||||||
|
_RuneLocale *_Read_RuneMagi(FILE *);
|
||||||
|
|
||||||
_RuneLocale *
|
_RuneLocale *
|
||||||
_Read_RuneMagi(fp)
|
_Read_RuneMagi(FILE *fp)
|
||||||
FILE *fp;
|
|
||||||
{
|
{
|
||||||
char *data;
|
char *fdata, *data;
|
||||||
void *lastp;
|
void *lastp;
|
||||||
|
_FileRuneLocale *frl;
|
||||||
_RuneLocale *rl;
|
_RuneLocale *rl;
|
||||||
|
_FileRuneEntry *frr;
|
||||||
_RuneEntry *rr;
|
_RuneEntry *rr;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int x, saverr;
|
int x, saverr;
|
||||||
|
void *variable;
|
||||||
|
_FileRuneEntry *runetype_ext_ranges;
|
||||||
|
_FileRuneEntry *maplower_ext_ranges;
|
||||||
|
_FileRuneEntry *mapupper_ext_ranges;
|
||||||
|
int runetype_ext_len = 0;
|
||||||
|
|
||||||
if (_fstat(fileno(fp), &sb) < 0)
|
if (_fstat(fileno(fp), &sb) < 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if (sb.st_size < sizeof(_RuneLocale)) {
|
if ((size_t)sb.st_size < sizeof(_FileRuneLocale)) {
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((data = malloc(sb.st_size)) == NULL)
|
if ((fdata = malloc(sb.st_size)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
rewind(fp); /* Someone might have read the magic number once already */
|
rewind(fp); /* Someone might have read the magic number once already */
|
||||||
if (errno) {
|
if (errno) {
|
||||||
saverr = errno;
|
saverr = errno;
|
||||||
free(data);
|
free(fdata);
|
||||||
errno = saverr;
|
errno = saverr;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fread(data, sb.st_size, 1, fp) != 1) {
|
if (fread(fdata, sb.st_size, 1, fp) != 1) {
|
||||||
saverr = errno;
|
saverr = errno;
|
||||||
free(data);
|
free(fdata);
|
||||||
errno = saverr;
|
errno = saverr;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl = (_RuneLocale *)data;
|
frl = (_FileRuneLocale *)fdata;
|
||||||
lastp = data + sb.st_size;
|
lastp = fdata + sb.st_size;
|
||||||
|
|
||||||
rl->__variable = rl + 1;
|
variable = frl + 1;
|
||||||
|
|
||||||
if (memcmp(rl->__magic, _RUNE_MAGIC_1, sizeof(rl->__magic))) {
|
if (memcmp(frl->magic, _FILE_RUNE_MAGIC_1, sizeof(frl->magic))) {
|
||||||
free(data);
|
free(fdata);
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl->__invalid_rune = ntohl(rl->__invalid_rune);
|
frl->variable_len = ntohl(frl->variable_len);
|
||||||
rl->__variable_len = ntohl(rl->__variable_len);
|
frl->runetype_ext_nranges = ntohl(frl->runetype_ext_nranges);
|
||||||
rl->__runetype_ext.__nranges = ntohl(rl->__runetype_ext.__nranges);
|
frl->maplower_ext_nranges = ntohl(frl->maplower_ext_nranges);
|
||||||
rl->__maplower_ext.__nranges = ntohl(rl->__maplower_ext.__nranges);
|
frl->mapupper_ext_nranges = ntohl(frl->mapupper_ext_nranges);
|
||||||
rl->__mapupper_ext.__nranges = ntohl(rl->__mapupper_ext.__nranges);
|
|
||||||
|
|
||||||
for (x = 0; x < _CACHED_RUNES; ++x) {
|
for (x = 0; x < _CACHED_RUNES; ++x) {
|
||||||
rl->__runetype[x] = ntohl(rl->__runetype[x]);
|
frl->runetype[x] = ntohl(frl->runetype[x]);
|
||||||
rl->__maplower[x] = ntohl(rl->__maplower[x]);
|
frl->maplower[x] = ntohl(frl->maplower[x]);
|
||||||
rl->__mapupper[x] = ntohl(rl->__mapupper[x]);
|
frl->mapupper[x] = ntohl(frl->mapupper[x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl->__runetype_ext.__ranges = (_RuneEntry *)rl->__variable;
|
runetype_ext_ranges = (_FileRuneEntry *)variable;
|
||||||
rl->__variable = rl->__runetype_ext.__ranges +
|
variable = runetype_ext_ranges + frl->runetype_ext_nranges;
|
||||||
rl->__runetype_ext.__nranges;
|
if (variable > lastp) {
|
||||||
if (rl->__variable > lastp) {
|
free(fdata);
|
||||||
free(data);
|
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl->__maplower_ext.__ranges = (_RuneEntry *)rl->__variable;
|
maplower_ext_ranges = (_FileRuneEntry *)variable;
|
||||||
rl->__variable = rl->__maplower_ext.__ranges +
|
variable = maplower_ext_ranges + frl->maplower_ext_nranges;
|
||||||
rl->__maplower_ext.__nranges;
|
if (variable > lastp) {
|
||||||
if (rl->__variable > lastp) {
|
free(fdata);
|
||||||
free(data);
|
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl->__mapupper_ext.__ranges = (_RuneEntry *)rl->__variable;
|
mapupper_ext_ranges = (_FileRuneEntry *)variable;
|
||||||
rl->__variable = rl->__mapupper_ext.__ranges +
|
variable = mapupper_ext_ranges + frl->mapupper_ext_nranges;
|
||||||
rl->__mapupper_ext.__nranges;
|
if (variable > lastp) {
|
||||||
if (rl->__variable > lastp) {
|
free(fdata);
|
||||||
free(data);
|
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = 0; x < rl->__runetype_ext.__nranges; ++x) {
|
frr = runetype_ext_ranges;
|
||||||
rr = rl->__runetype_ext.__ranges;
|
for (x = 0; x < frl->runetype_ext_nranges; ++x) {
|
||||||
|
uint32_t *types;
|
||||||
|
|
||||||
rr[x].__min = ntohl(rr[x].__min);
|
frr[x].min = ntohl(frr[x].min);
|
||||||
rr[x].__max = ntohl(rr[x].__max);
|
frr[x].max = ntohl(frr[x].max);
|
||||||
if ((rr[x].__map = ntohl(rr[x].__map)) == 0) {
|
frr[x].map = ntohl(frr[x].map);
|
||||||
int len = rr[x].__max - rr[x].__min + 1;
|
if (frr[x].map == 0) {
|
||||||
rr[x].__types = rl->__variable;
|
int len = frr[x].max - frr[x].min + 1;
|
||||||
rl->__variable = rr[x].__types + len;
|
types = variable;
|
||||||
if (rl->__variable > lastp) {
|
variable = types + len;
|
||||||
free(data);
|
runetype_ext_len += len;
|
||||||
|
if (variable > lastp) {
|
||||||
|
free(fdata);
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
while (len-- > 0)
|
while (len-- > 0)
|
||||||
rr[x].__types[len] = ntohl(rr[x].__types[len]);
|
types[len] = ntohl(types[len]);
|
||||||
} else
|
}
|
||||||
rr[x].__types = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = 0; x < rl->__maplower_ext.__nranges; ++x) {
|
frr = maplower_ext_ranges;
|
||||||
rr = rl->__maplower_ext.__ranges;
|
for (x = 0; x < frl->maplower_ext_nranges; ++x) {
|
||||||
|
frr[x].min = ntohl(frr[x].min);
|
||||||
rr[x].__min = ntohl(rr[x].__min);
|
frr[x].max = ntohl(frr[x].max);
|
||||||
rr[x].__max = ntohl(rr[x].__max);
|
frr[x].map = ntohl(frr[x].map);
|
||||||
rr[x].__map = ntohl(rr[x].__map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = 0; x < rl->__mapupper_ext.__nranges; ++x) {
|
frr = mapupper_ext_ranges;
|
||||||
rr = rl->__mapupper_ext.__ranges;
|
for (x = 0; x < frl->mapupper_ext_nranges; ++x) {
|
||||||
|
frr[x].min = ntohl(frr[x].min);
|
||||||
rr[x].__min = ntohl(rr[x].__min);
|
frr[x].max = ntohl(frr[x].max);
|
||||||
rr[x].__max = ntohl(rr[x].__max);
|
frr[x].map = ntohl(frr[x].map);
|
||||||
rr[x].__map = ntohl(rr[x].__map);
|
|
||||||
}
|
}
|
||||||
if (((char *)rl->__variable) + rl->__variable_len > (char *)lastp) {
|
if ((char *)variable + frl->variable_len > (char *)lastp) {
|
||||||
free(data);
|
free(fdata);
|
||||||
errno = EFTYPE;
|
errno = EFTYPE;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert from disk format to host format.
|
||||||
|
*/
|
||||||
|
data = malloc(sizeof(_RuneLocale) +
|
||||||
|
(frl->runetype_ext_nranges + frl->maplower_ext_nranges +
|
||||||
|
frl->mapupper_ext_nranges) * sizeof(_RuneEntry) +
|
||||||
|
runetype_ext_len * sizeof(*rr->__types) +
|
||||||
|
frl->variable_len);
|
||||||
|
if (data == NULL) {
|
||||||
|
saverr = errno;
|
||||||
|
free(fdata);
|
||||||
|
errno = saverr;
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
rl = (_RuneLocale *)data;
|
||||||
|
rl->__variable = rl + 1;
|
||||||
|
|
||||||
|
memcpy(rl->__magic, _RUNE_MAGIC_1, sizeof(rl->__magic));
|
||||||
|
memcpy(rl->__encoding, frl->encoding, sizeof(rl->__encoding));
|
||||||
|
rl->__invalid_rune = 0;
|
||||||
|
|
||||||
|
rl->__variable_len = frl->variable_len;
|
||||||
|
rl->__runetype_ext.__nranges = frl->runetype_ext_nranges;
|
||||||
|
rl->__maplower_ext.__nranges = frl->maplower_ext_nranges;
|
||||||
|
rl->__mapupper_ext.__nranges = frl->mapupper_ext_nranges;
|
||||||
|
|
||||||
|
for (x = 0; x < _CACHED_RUNES; ++x) {
|
||||||
|
rl->__runetype[x] = frl->runetype[x];
|
||||||
|
rl->__maplower[x] = frl->maplower[x];
|
||||||
|
rl->__mapupper[x] = frl->mapupper[x];
|
||||||
|
}
|
||||||
|
|
||||||
|
rl->__runetype_ext.__ranges = (_RuneEntry *)rl->__variable;
|
||||||
|
rl->__variable = rl->__runetype_ext.__ranges +
|
||||||
|
rl->__runetype_ext.__nranges;
|
||||||
|
|
||||||
|
rl->__maplower_ext.__ranges = (_RuneEntry *)rl->__variable;
|
||||||
|
rl->__variable = rl->__maplower_ext.__ranges +
|
||||||
|
rl->__maplower_ext.__nranges;
|
||||||
|
|
||||||
|
rl->__mapupper_ext.__ranges = (_RuneEntry *)rl->__variable;
|
||||||
|
rl->__variable = rl->__mapupper_ext.__ranges +
|
||||||
|
rl->__mapupper_ext.__nranges;
|
||||||
|
|
||||||
|
variable = mapupper_ext_ranges + frl->mapupper_ext_nranges;
|
||||||
|
frr = runetype_ext_ranges;
|
||||||
|
rr = rl->__runetype_ext.__ranges;
|
||||||
|
for (x = 0; x < rl->__runetype_ext.__nranges; ++x) {
|
||||||
|
uint32_t *types;
|
||||||
|
|
||||||
|
rr[x].__min = frr[x].min;
|
||||||
|
rr[x].__max = frr[x].max;
|
||||||
|
rr[x].__map = frr[x].map;
|
||||||
|
if (rr[x].__map == 0) {
|
||||||
|
int len = rr[x].__max - rr[x].__min + 1;
|
||||||
|
types = variable;
|
||||||
|
variable = types + len;
|
||||||
|
rr[x].__types = rl->__variable;
|
||||||
|
rl->__variable = rr[x].__types + len;
|
||||||
|
while (len-- > 0)
|
||||||
|
rr[x].__types[len] = types[len];
|
||||||
|
} else
|
||||||
|
rr[x].__types = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
frr = maplower_ext_ranges;
|
||||||
|
rr = rl->__maplower_ext.__ranges;
|
||||||
|
for (x = 0; x < rl->__maplower_ext.__nranges; ++x) {
|
||||||
|
rr[x].__min = frr[x].min;
|
||||||
|
rr[x].__max = frr[x].max;
|
||||||
|
rr[x].__map = frr[x].map;
|
||||||
|
}
|
||||||
|
|
||||||
|
frr = mapupper_ext_ranges;
|
||||||
|
rr = rl->__mapupper_ext.__ranges;
|
||||||
|
for (x = 0; x < rl->__mapupper_ext.__nranges; ++x) {
|
||||||
|
rr[x].__min = frr[x].min;
|
||||||
|
rr[x].__max = frr[x].max;
|
||||||
|
rr[x].__map = frr[x].map;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(rl->__variable, variable, rl->__variable_len);
|
||||||
|
free(fdata);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Go out and zero pointers that should be zero.
|
* Go out and zero pointers that should be zero.
|
||||||
*/
|
*/
|
||||||
if (!rl->__variable_len)
|
if (!rl->__variable_len)
|
||||||
rl->__variable = 0;
|
rl->__variable = NULL;
|
||||||
|
|
||||||
if (!rl->__runetype_ext.__nranges)
|
if (!rl->__runetype_ext.__nranges)
|
||||||
rl->__runetype_ext.__ranges = 0;
|
rl->__runetype_ext.__ranges = NULL;
|
||||||
|
|
||||||
if (!rl->__maplower_ext.__nranges)
|
if (!rl->__maplower_ext.__nranges)
|
||||||
rl->__maplower_ext.__ranges = 0;
|
rl->__maplower_ext.__ranges = NULL;
|
||||||
|
|
||||||
if (!rl->__mapupper_ext.__nranges)
|
if (!rl->__mapupper_ext.__nranges)
|
||||||
rl->__mapupper_ext.__ranges = 0;
|
rl->__mapupper_ext.__ranges = NULL;
|
||||||
|
|
||||||
return (rl);
|
return (rl);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
* is created, otherwise 1.
|
* is created, otherwise 1.
|
||||||
*/
|
*/
|
||||||
#undef __FreeBSD_version
|
#undef __FreeBSD_version
|
||||||
#define __FreeBSD_version 600015 /* Master, propagated to newvers */
|
#define __FreeBSD_version 600016 /* Master, propagated to newvers */
|
||||||
|
|
||||||
#ifndef LOCORE
|
#ifndef LOCORE
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -26,6 +26,11 @@ INCS+= elf-hints.h
|
|||||||
INCS+= stdbool.h
|
INCS+= stdbool.h
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
# usr.bin/mklocale needs <runefile.h>.
|
||||||
|
.if !exists(/usr/include/runefile.h)
|
||||||
|
INCS+= runefile.h
|
||||||
|
.endif
|
||||||
|
|
||||||
# usr.bin/xargs needs <nl_langinfo.h>.
|
# usr.bin/xargs needs <nl_langinfo.h>.
|
||||||
.if !exists(/usr/include/langinfo.h)
|
.if !exists(/usr/include/langinfo.h)
|
||||||
INCS+= langinfo.h
|
INCS+= langinfo.h
|
||||||
|
@ -37,18 +37,20 @@
|
|||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This should look a LOT like a _RuneEntry
|
* This should look a LOT like a _RuneEntry
|
||||||
*/
|
*/
|
||||||
typedef struct rune_list {
|
typedef struct rune_list {
|
||||||
rune_t min;
|
int32_t min;
|
||||||
rune_t max;
|
int32_t max;
|
||||||
rune_t map;
|
int32_t map;
|
||||||
unsigned long *types;
|
uint32_t *types;
|
||||||
struct rune_list *next;
|
struct rune_list *next;
|
||||||
} rune_list;
|
} rune_list;
|
||||||
|
|
||||||
typedef struct rune_map {
|
typedef struct rune_map {
|
||||||
unsigned long map[_CACHED_RUNES];
|
uint32_t map[_CACHED_RUNES];
|
||||||
rune_list *root;
|
rune_list *root;
|
||||||
} rune_map;
|
} rune_map;
|
||||||
|
@ -45,7 +45,6 @@ static char sccsid[] = "@(#)lex.l 8.1 (Berkeley) 6/6/93";
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <runetype.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <runetype.h>
|
#include <runefile.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -59,9 +59,9 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
static void *xmalloc(unsigned int sz);
|
static void *xmalloc(unsigned int sz);
|
||||||
static unsigned long *xlalloc(unsigned int sz);
|
static uint32_t *xlalloc(unsigned int sz);
|
||||||
void yyerror(const char *s);
|
void yyerror(const char *s);
|
||||||
static unsigned long *xrelalloc(unsigned long *old, unsigned int sz);
|
static uint32_t *xrelalloc(uint32_t *old, unsigned int sz);
|
||||||
static void dump_tables(void);
|
static void dump_tables(void);
|
||||||
static void cleanout(void);
|
static void cleanout(void);
|
||||||
|
|
||||||
@ -71,17 +71,17 @@ rune_map maplower = { { 0 }, NULL };
|
|||||||
rune_map mapupper = { { 0 }, NULL };
|
rune_map mapupper = { { 0 }, NULL };
|
||||||
rune_map types = { { 0 }, NULL };
|
rune_map types = { { 0 }, NULL };
|
||||||
|
|
||||||
_RuneLocale new_locale = { "", "", NULL, NULL, 0, {}, {}, {},
|
_FileRuneLocale new_locale = { "", "", {}, {}, {}, 0, 0, 0, 0 };
|
||||||
{0, NULL}, {0, NULL}, {0, NULL}, NULL, 0 };
|
char *variable = NULL;
|
||||||
|
|
||||||
void set_map(rune_map *, rune_list *, unsigned long);
|
void set_map(rune_map *, rune_list *, uint32_t);
|
||||||
void set_digitmap(rune_map *, rune_list *);
|
void set_digitmap(rune_map *, rune_list *);
|
||||||
void add_map(rune_map *, rune_list *, unsigned long);
|
void add_map(rune_map *, rune_list *, uint32_t);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%union {
|
%union {
|
||||||
rune_t rune;
|
int32_t rune;
|
||||||
int i;
|
int i;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
@ -126,17 +126,15 @@ entry : ENCODING STRING
|
|||||||
strcmp($2, "BIG5") &&
|
strcmp($2, "BIG5") &&
|
||||||
strcmp($2, "MSKanji"))
|
strcmp($2, "MSKanji"))
|
||||||
warnx("ENCODING %s is not supported by libc", $2);
|
warnx("ENCODING %s is not supported by libc", $2);
|
||||||
strncpy(new_locale.__encoding, $2,
|
strncpy(new_locale.encoding, $2,
|
||||||
sizeof(new_locale.__encoding)); }
|
sizeof(new_locale.encoding)); }
|
||||||
| VARIABLE
|
| VARIABLE
|
||||||
{ new_locale.__variable_len = strlen($1) + 1;
|
{ new_locale.variable_len = strlen($1) + 1;
|
||||||
new_locale.__variable = xmalloc(new_locale.__variable_len);
|
variable = xmalloc(new_locale.variable_len);
|
||||||
strcpy((char *)new_locale.__variable, $1);
|
strcpy(variable, $1);
|
||||||
}
|
}
|
||||||
| INVALID RUNE
|
| INVALID RUNE
|
||||||
{ warnx("the INVALID keyword is deprecated");
|
{ warnx("the INVALID keyword is deprecated"); }
|
||||||
new_locale.__invalid_rune = $2;
|
|
||||||
}
|
|
||||||
| LIST list
|
| LIST list
|
||||||
{ set_map(&types, $2, $1); }
|
{ set_map(&types, $2, $1); }
|
||||||
| MAPLOWER map
|
| MAPLOWER map
|
||||||
@ -259,8 +257,7 @@ main(int ac, char *av[])
|
|||||||
mapupper.map[x] = x;
|
mapupper.map[x] = x;
|
||||||
maplower.map[x] = x;
|
maplower.map[x] = x;
|
||||||
}
|
}
|
||||||
new_locale.__invalid_rune = _CurrentRuneLocale->__invalid_rune;
|
memcpy(new_locale.magic, _FILE_RUNE_MAGIC_1, sizeof(new_locale.magic));
|
||||||
memcpy(new_locale.__magic, _RUNE_MAGIC_1, sizeof(new_locale.__magic));
|
|
||||||
|
|
||||||
yyparse();
|
yyparse();
|
||||||
|
|
||||||
@ -291,23 +288,23 @@ xmalloc(sz)
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long *
|
static uint32_t *
|
||||||
xlalloc(sz)
|
xlalloc(sz)
|
||||||
unsigned int sz;
|
unsigned int sz;
|
||||||
{
|
{
|
||||||
unsigned long *r = (unsigned long *)malloc(sz * sizeof(unsigned long));
|
uint32_t *r = (uint32_t *)malloc(sz * sizeof(uint32_t));
|
||||||
if (!r)
|
if (!r)
|
||||||
errx(1, "xlalloc");
|
errx(1, "xlalloc");
|
||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long *
|
static uint32_t *
|
||||||
xrelalloc(old, sz)
|
xrelalloc(old, sz)
|
||||||
unsigned long *old;
|
uint32_t *old;
|
||||||
unsigned int sz;
|
unsigned int sz;
|
||||||
{
|
{
|
||||||
unsigned long *r = (unsigned long *)realloc((char *)old,
|
uint32_t *r = (uint32_t *)realloc((char *)old,
|
||||||
sz * sizeof(unsigned long));
|
sz * sizeof(uint32_t));
|
||||||
if (!r)
|
if (!r)
|
||||||
errx(1, "xrelalloc");
|
errx(1, "xrelalloc");
|
||||||
return(r);
|
return(r);
|
||||||
@ -317,7 +314,7 @@ void
|
|||||||
set_map(map, list, flag)
|
set_map(map, list, flag)
|
||||||
rune_map *map;
|
rune_map *map;
|
||||||
rune_list *list;
|
rune_list *list;
|
||||||
unsigned long flag;
|
uint32_t flag;
|
||||||
{
|
{
|
||||||
while (list) {
|
while (list) {
|
||||||
rune_list *nlist = list->next;
|
rune_list *nlist = list->next;
|
||||||
@ -331,7 +328,7 @@ set_digitmap(map, list)
|
|||||||
rune_map *map;
|
rune_map *map;
|
||||||
rune_list *list;
|
rune_list *list;
|
||||||
{
|
{
|
||||||
rune_t i;
|
int32_t i;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
rune_list *nlist = list->next;
|
rune_list *nlist = list->next;
|
||||||
@ -352,12 +349,12 @@ void
|
|||||||
add_map(map, list, flag)
|
add_map(map, list, flag)
|
||||||
rune_map *map;
|
rune_map *map;
|
||||||
rune_list *list;
|
rune_list *list;
|
||||||
unsigned long flag;
|
uint32_t flag;
|
||||||
{
|
{
|
||||||
rune_t i;
|
int32_t i;
|
||||||
rune_list *lr = 0;
|
rune_list *lr = 0;
|
||||||
rune_list *r;
|
rune_list *r;
|
||||||
rune_t run;
|
int32_t run;
|
||||||
|
|
||||||
while (list->min < _CACHED_RUNES && list->min <= list->max) {
|
while (list->min < _CACHED_RUNES && list->min <= list->max) {
|
||||||
if (flag)
|
if (flag)
|
||||||
@ -568,7 +565,7 @@ dump_tables()
|
|||||||
for(list = types.root; list; list = list->next) {
|
for(list = types.root; list; list = list->next) {
|
||||||
list->map = list->types[0];
|
list->map = list->types[0];
|
||||||
for (x = 1; x < list->max - list->min + 1; ++x) {
|
for (x = 1; x < list->max - list->min + 1; ++x) {
|
||||||
if ((rune_t)list->types[x] != list->map) {
|
if ((int32_t)list->types[x] != list->map) {
|
||||||
list->map = 0;
|
list->map = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -577,7 +574,7 @@ dump_tables()
|
|||||||
|
|
||||||
first_d = curr_d = -1;
|
first_d = curr_d = -1;
|
||||||
for (x = 0; x < _CACHED_RUNES; ++x) {
|
for (x = 0; x < _CACHED_RUNES; ++x) {
|
||||||
unsigned long r = types.map[x];
|
uint32_t r = types.map[x];
|
||||||
|
|
||||||
if (r & _CTYPE_D) {
|
if (r & _CTYPE_D) {
|
||||||
if (first_d < 0)
|
if (first_d < 0)
|
||||||
@ -598,8 +595,6 @@ dump_tables()
|
|||||||
else if (curr_d - first_d < 9)
|
else if (curr_d - first_d < 9)
|
||||||
errx(1, "error: DIGIT range is too small in the single byte area");
|
errx(1, "error: DIGIT range is too small in the single byte area");
|
||||||
|
|
||||||
new_locale.__invalid_rune = htonl(new_locale.__invalid_rune);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in our tables. Do this in network order so that
|
* Fill in our tables. Do this in network order so that
|
||||||
* diverse machines have a chance of sharing data.
|
* diverse machines have a chance of sharing data.
|
||||||
@ -607,9 +602,9 @@ dump_tables()
|
|||||||
* word size. Sigh. We tried.)
|
* word size. Sigh. We tried.)
|
||||||
*/
|
*/
|
||||||
for (x = 0; x < _CACHED_RUNES; ++x) {
|
for (x = 0; x < _CACHED_RUNES; ++x) {
|
||||||
new_locale.__runetype[x] = htonl(types.map[x]);
|
new_locale.runetype[x] = htonl(types.map[x]);
|
||||||
new_locale.__maplower[x] = htonl(maplower.map[x]);
|
new_locale.maplower[x] = htonl(maplower.map[x]);
|
||||||
new_locale.__mapupper[x] = htonl(mapupper.map[x]);
|
new_locale.mapupper[x] = htonl(mapupper.map[x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -618,38 +613,38 @@ dump_tables()
|
|||||||
list = types.root;
|
list = types.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
new_locale.__runetype_ext.__nranges++;
|
new_locale.runetype_ext_nranges++;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
new_locale.__runetype_ext.__nranges =
|
new_locale.runetype_ext_nranges =
|
||||||
htonl(new_locale.__runetype_ext.__nranges);
|
htonl(new_locale.runetype_ext_nranges);
|
||||||
|
|
||||||
list = maplower.root;
|
list = maplower.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
new_locale.__maplower_ext.__nranges++;
|
new_locale.maplower_ext_nranges++;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
new_locale.__maplower_ext.__nranges =
|
new_locale.maplower_ext_nranges =
|
||||||
htonl(new_locale.__maplower_ext.__nranges);
|
htonl(new_locale.maplower_ext_nranges);
|
||||||
|
|
||||||
list = mapupper.root;
|
list = mapupper.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
new_locale.__mapupper_ext.__nranges++;
|
new_locale.mapupper_ext_nranges++;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
new_locale.__mapupper_ext.__nranges =
|
new_locale.mapupper_ext_nranges =
|
||||||
htonl(new_locale.__mapupper_ext.__nranges);
|
htonl(new_locale.mapupper_ext_nranges);
|
||||||
|
|
||||||
new_locale.__variable_len = htonl(new_locale.__variable_len);
|
new_locale.variable_len = htonl(new_locale.variable_len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Okay, we are now ready to write the new locale file.
|
* Okay, we are now ready to write the new locale file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PART 1: The _RuneLocale structure
|
* PART 1: The _FileRuneLocale structure
|
||||||
*/
|
*/
|
||||||
if (fwrite((char *)&new_locale, sizeof(new_locale), 1, fp) != 1) {
|
if (fwrite((char *)&new_locale, sizeof(new_locale), 1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
@ -661,11 +656,11 @@ dump_tables()
|
|||||||
list = types.root;
|
list = types.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
_RuneEntry re;
|
_FileRuneEntry re;
|
||||||
|
|
||||||
re.__min = htonl(list->min);
|
re.min = htonl(list->min);
|
||||||
re.__max = htonl(list->max);
|
re.max = htonl(list->max);
|
||||||
re.__map = htonl(list->map);
|
re.map = htonl(list->map);
|
||||||
|
|
||||||
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
@ -680,11 +675,11 @@ dump_tables()
|
|||||||
list = maplower.root;
|
list = maplower.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
_RuneEntry re;
|
_FileRuneEntry re;
|
||||||
|
|
||||||
re.__min = htonl(list->min);
|
re.min = htonl(list->min);
|
||||||
re.__max = htonl(list->max);
|
re.max = htonl(list->max);
|
||||||
re.__map = htonl(list->map);
|
re.map = htonl(list->map);
|
||||||
|
|
||||||
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
@ -699,11 +694,11 @@ dump_tables()
|
|||||||
list = mapupper.root;
|
list = mapupper.root;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
_RuneEntry re;
|
_FileRuneEntry re;
|
||||||
|
|
||||||
re.__min = htonl(list->min);
|
re.min = htonl(list->min);
|
||||||
re.__max = htonl(list->max);
|
re.max = htonl(list->max);
|
||||||
re.__map = htonl(list->map);
|
re.map = htonl(list->map);
|
||||||
|
|
||||||
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
if (fwrite((char *)&re, sizeof(re), 1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
@ -723,7 +718,7 @@ dump_tables()
|
|||||||
|
|
||||||
if (!list->map) {
|
if (!list->map) {
|
||||||
if (fwrite((char *)list->types,
|
if (fwrite((char *)list->types,
|
||||||
(list->max - list->min + 1) * sizeof(unsigned long),
|
(list->max - list->min + 1) * sizeof(uint32_t),
|
||||||
1, fp) != 1) {
|
1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -732,10 +727,10 @@ dump_tables()
|
|||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* PART 5: And finally the variable data
|
* PART 6: And finally the variable data
|
||||||
*/
|
*/
|
||||||
if (fwrite((char *)new_locale.__variable,
|
if (fwrite(variable,
|
||||||
ntohl(new_locale.__variable_len), 1, fp) != 1) {
|
ntohl(new_locale.variable_len), 1, fp) != 1) {
|
||||||
perror(locale_file);
|
perror(locale_file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -748,10 +743,10 @@ dump_tables()
|
|||||||
if (!debug)
|
if (!debug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (new_locale.__encoding[0])
|
if (new_locale.encoding[0])
|
||||||
fprintf(stderr, "ENCODING %s\n", new_locale.__encoding);
|
fprintf(stderr, "ENCODING %s\n", new_locale.encoding);
|
||||||
if (new_locale.__variable)
|
if (variable)
|
||||||
fprintf(stderr, "VARIABLE %s\n", (char *)new_locale.__variable);
|
fprintf(stderr, "VARIABLE %s\n", variable);
|
||||||
|
|
||||||
fprintf(stderr, "\nMAPLOWER:\n\n");
|
fprintf(stderr, "\nMAPLOWER:\n\n");
|
||||||
|
|
||||||
@ -759,7 +754,7 @@ dump_tables()
|
|||||||
if (isprint(maplower.map[x]))
|
if (isprint(maplower.map[x]))
|
||||||
fprintf(stderr, " '%c'", (int)maplower.map[x]);
|
fprintf(stderr, " '%c'", (int)maplower.map[x]);
|
||||||
else if (maplower.map[x])
|
else if (maplower.map[x])
|
||||||
fprintf(stderr, "%04lx", maplower.map[x]);
|
fprintf(stderr, "%04x", maplower.map[x]);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "%4x", 0);
|
fprintf(stderr, "%4x", 0);
|
||||||
if ((x & 0xf) == 0xf)
|
if ((x & 0xf) == 0xf)
|
||||||
@ -778,7 +773,7 @@ dump_tables()
|
|||||||
if (isprint(mapupper.map[x]))
|
if (isprint(mapupper.map[x]))
|
||||||
fprintf(stderr, " '%c'", (int)mapupper.map[x]);
|
fprintf(stderr, " '%c'", (int)mapupper.map[x]);
|
||||||
else if (mapupper.map[x])
|
else if (mapupper.map[x])
|
||||||
fprintf(stderr, "%04lx", mapupper.map[x]);
|
fprintf(stderr, "%04x", mapupper.map[x]);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "%4x", 0);
|
fprintf(stderr, "%4x", 0);
|
||||||
if ((x & 0xf) == 0xf)
|
if ((x & 0xf) == 0xf)
|
||||||
@ -795,7 +790,7 @@ dump_tables()
|
|||||||
fprintf(stderr, "\nTYPES:\n\n");
|
fprintf(stderr, "\nTYPES:\n\n");
|
||||||
|
|
||||||
for (x = 0; x < _CACHED_RUNES; ++x) {
|
for (x = 0; x < _CACHED_RUNES; ++x) {
|
||||||
unsigned long r = types.map[x];
|
uint32_t r = types.map[x];
|
||||||
|
|
||||||
if (r) {
|
if (r) {
|
||||||
if (isprint(x))
|
if (isprint(x))
|
||||||
@ -823,10 +818,10 @@ dump_tables()
|
|||||||
|
|
||||||
for (list = types.root; list; list = list->next) {
|
for (list = types.root; list; list = list->next) {
|
||||||
if (list->map && list->min + 3 < list->max) {
|
if (list->map && list->min + 3 < list->max) {
|
||||||
unsigned long r = list->map;
|
uint32_t r = list->map;
|
||||||
|
|
||||||
fprintf(stderr, "%04lx: %2d",
|
fprintf(stderr, "%04x: %2d",
|
||||||
(unsigned long)list->min, (int)(r & 0xff));
|
(uint32_t)list->min, (int)(r & 0xff));
|
||||||
|
|
||||||
fprintf(stderr, " %4s", (r & _CTYPE_A) ? "alph" : "");
|
fprintf(stderr, " %4s", (r & _CTYPE_A) ? "alph" : "");
|
||||||
fprintf(stderr, " %4s", (r & _CTYPE_C) ? "ctrl" : "");
|
fprintf(stderr, " %4s", (r & _CTYPE_C) ? "ctrl" : "");
|
||||||
@ -844,8 +839,8 @@ dump_tables()
|
|||||||
fprintf(stderr, " %4s", (r & _CTYPE_Q) ? "phon" : "");
|
fprintf(stderr, " %4s", (r & _CTYPE_Q) ? "phon" : "");
|
||||||
fprintf(stderr, "\n...\n");
|
fprintf(stderr, "\n...\n");
|
||||||
|
|
||||||
fprintf(stderr, "%04lx: %2d",
|
fprintf(stderr, "%04x: %2d",
|
||||||
(unsigned long)list->max, (int)(r & 0xff));
|
(uint32_t)list->max, (int)(r & 0xff));
|
||||||
|
|
||||||
fprintf(stderr, " %4s", (r & _CTYPE_A) ? "alph" : "");
|
fprintf(stderr, " %4s", (r & _CTYPE_A) ? "alph" : "");
|
||||||
fprintf(stderr, " %4s", (r & _CTYPE_C) ? "ctrl" : "");
|
fprintf(stderr, " %4s", (r & _CTYPE_C) ? "ctrl" : "");
|
||||||
@ -864,7 +859,7 @@ dump_tables()
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
} else
|
} else
|
||||||
for (x = list->min; x <= list->max; ++x) {
|
for (x = list->min; x <= list->max; ++x) {
|
||||||
unsigned long r = ntohl(list->types[x - list->min]);
|
uint32_t r = ntohl(list->types[x - list->min]);
|
||||||
|
|
||||||
if (r) {
|
if (r) {
|
||||||
fprintf(stderr, "%04x: %2d", x, (int)(r & 0xff));
|
fprintf(stderr, "%04x: %2d", x, (int)(r & 0xff));
|
||||||
|
Loading…
Reference in New Issue
Block a user