Deleted Added
full compact
euc.c (129775) euc.c (130961)
1/*-
2 * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved.
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Paul Borman at Krystal Technologies.
8 *

--- 25 unchanged lines hidden (view full) ---

34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#if defined(LIBC_SCCS) && !defined(lint)
39static char sccsid[] = "@(#)euc.c 8.1 (Berkeley) 6/4/93";
40#endif /* LIBC_SCCS and not lint */
41#include <sys/param.h>
1/*-
2 * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved.
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Paul Borman at Krystal Technologies.
8 *

--- 25 unchanged lines hidden (view full) ---

34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#if defined(LIBC_SCCS) && !defined(lint)
39static char sccsid[] = "@(#)euc.c 8.1 (Berkeley) 6/4/93";
40#endif /* LIBC_SCCS and not lint */
41#include <sys/param.h>
42__FBSDID("$FreeBSD: head/lib/libc/locale/euc.c 129775 2004-05-27 10:54:34Z tjr $");
42__FBSDID("$FreeBSD: head/lib/libc/locale/euc.c 130961 2004-06-23 07:01:44Z tjr $");
43
44#include <errno.h>
45#include <limits.h>
46#include <runetype.h>
47#include <stdlib.h>
48#include <string.h>
49#include <wchar.h>
50#include "mblocal.h"

--- 18 unchanged lines hidden (view full) ---

69
70int
71_EUC_init(_RuneLocale *rl)
72{
73 _EucInfo *ei;
74 int x, new__mb_cur_max;
75 char *v, *e;
76
43
44#include <errno.h>
45#include <limits.h>
46#include <runetype.h>
47#include <stdlib.h>
48#include <string.h>
49#include <wchar.h>
50#include "mblocal.h"

--- 18 unchanged lines hidden (view full) ---

69
70int
71_EUC_init(_RuneLocale *rl)
72{
73 _EucInfo *ei;
74 int x, new__mb_cur_max;
75 char *v, *e;
76
77 if (rl->variable == NULL)
77 if (rl->__variable == NULL)
78 return (EFTYPE);
79
78 return (EFTYPE);
79
80 v = (char *)rl->variable;
80 v = (char *)rl->__variable;
81
82 while (*v == ' ' || *v == '\t')
83 ++v;
84
85 if ((ei = malloc(sizeof(_EucInfo))) == NULL)
86 return (errno == 0 ? ENOMEM : errno);
87
88 new__mb_cur_max = 0;

--- 15 unchanged lines hidden (view full) ---

104 while (*v == ' ' || *v == '\t')
105 ++v;
106 }
107 ei->mask = (int)strtol(v, &e, 0);
108 if (v == e || !(v = e)) {
109 free(ei);
110 return (EFTYPE);
111 }
81
82 while (*v == ' ' || *v == '\t')
83 ++v;
84
85 if ((ei = malloc(sizeof(_EucInfo))) == NULL)
86 return (errno == 0 ? ENOMEM : errno);
87
88 new__mb_cur_max = 0;

--- 15 unchanged lines hidden (view full) ---

104 while (*v == ' ' || *v == '\t')
105 ++v;
106 }
107 ei->mask = (int)strtol(v, &e, 0);
108 if (v == e || !(v = e)) {
109 free(ei);
110 return (EFTYPE);
111 }
112 rl->variable = ei;
113 rl->variable_len = sizeof(_EucInfo);
112 rl->__variable = ei;
113 rl->__variable_len = sizeof(_EucInfo);
114 _CurrentRuneLocale = rl;
115 __mb_cur_max = new__mb_cur_max;
116 __mbrtowc = _EUC_mbrtowc;
117 __wcrtomb = _EUC_wcrtomb;
118 __mbsinit = _EUC_mbsinit;
119 return (0);
120}
121
122int
123_EUC_mbsinit(const mbstate_t *ps)
124{
125
126 return (ps == NULL || ((const _EucState *)ps)->want == 0);
127}
128
114 _CurrentRuneLocale = rl;
115 __mb_cur_max = new__mb_cur_max;
116 __mbrtowc = _EUC_mbrtowc;
117 __wcrtomb = _EUC_wcrtomb;
118 __mbsinit = _EUC_mbsinit;
119 return (0);
120}
121
122int
123_EUC_mbsinit(const mbstate_t *ps)
124{
125
126 return (ps == NULL || ((const _EucState *)ps)->want == 0);
127}
128
129#define CEI ((_EucInfo *)(_CurrentRuneLocale->variable))
129#define CEI ((_EucInfo *)(_CurrentRuneLocale->__variable))
130
131#define _SS2 0x008e
132#define _SS3 0x008f
133
134#define GR_BITS 0x80808080 /* XXX: to be fixed */
135
136static __inline int
137_euc_set(u_int c)

--- 127 unchanged lines hidden ---
130
131#define _SS2 0x008e
132#define _SS3 0x008f
133
134#define GR_BITS 0x80808080 /* XXX: to be fixed */
135
136static __inline int
137_euc_set(u_int c)

--- 127 unchanged lines hidden ---