collate.c (92986) | collate.c (93399) |
---|---|
1/*- 2 * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua> 3 * at Electronni Visti IA, Kiev, Ukraine. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua> 3 * at Electronni Visti IA, Kiev, Ukraine. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/lib/libc/locale/collate.c 92986 2002-03-22 21:53:29Z obrien $"); | 29__FBSDID("$FreeBSD: head/lib/libc/locale/collate.c 93399 2002-03-29 22:43:43Z markm $"); |
30 31#include "namespace.h" 32#include <rune.h> 33#include <stdio.h> 34#include <stdlib.h> 35#include <string.h> 36#include <errno.h> 37#include <unistd.h> 38#include <sysexits.h> 39#include "un-namespace.h" 40 41#include "collate.h" 42#include "setlocale.h" 43 | 30 31#include "namespace.h" 32#include <rune.h> 33#include <stdio.h> 34#include <stdlib.h> 35#include <string.h> 36#include <errno.h> 37#include <unistd.h> 38#include <sysexits.h> 39#include "un-namespace.h" 40 41#include "collate.h" 42#include "setlocale.h" 43 |
44#include "libc_private.h" 45 |
|
44int __collate_load_error = 1; 45int __collate_substitute_nontrivial; 46char __collate_version[STR_LEN]; 47u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN]; 48struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1]; 49struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE]; 50 51#define FREAD(a, b, c, d) \ --- 119 unchanged lines hidden (view full) --- 171 if (t == NULL) 172 __collate_err(EX_OSERR, __FUNCTION__); 173 return t; 174} 175 176void 177__collate_err(int ex, const char *f) 178{ | 46int __collate_load_error = 1; 47int __collate_substitute_nontrivial; 48char __collate_version[STR_LEN]; 49u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN]; 50struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1]; 51struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE]; 52 53#define FREAD(a, b, c, d) \ --- 119 unchanged lines hidden (view full) --- 173 if (t == NULL) 174 __collate_err(EX_OSERR, __FUNCTION__); 175 return t; 176} 177 178void 179__collate_err(int ex, const char *f) 180{ |
179 extern char *__progname; /* Program name, from crt0. */ | |
180 const char *s; 181 int serrno = errno; 182 | 181 const char *s; 182 int serrno = errno; 183 |
183 s = __progname; | 184 s = _getprogname(); |
184 _write(STDERR_FILENO, s, strlen(s)); 185 _write(STDERR_FILENO, ": ", 2); 186 s = f; 187 _write(STDERR_FILENO, s, strlen(s)); 188 _write(STDERR_FILENO, ": ", 2); 189 s = strerror(serrno); 190 _write(STDERR_FILENO, s, strlen(s)); 191 _write(STDERR_FILENO, "\n", 1); --- 24 unchanged lines hidden --- | 185 _write(STDERR_FILENO, s, strlen(s)); 186 _write(STDERR_FILENO, ": ", 2); 187 s = f; 188 _write(STDERR_FILENO, s, strlen(s)); 189 _write(STDERR_FILENO, ": ", 2); 190 s = strerror(serrno); 191 _write(STDERR_FILENO, s, strlen(s)); 192 _write(STDERR_FILENO, "\n", 1); --- 24 unchanged lines hidden --- |