From 993b3242cdc37152fbbc7fbd5ce22b2734b04b23 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 29 Mar 1997 17:32:35 +0000 Subject: Update. 1997-03-29 17:39 Ulrich Drepper * math/Makefile (routines): Add carg, s_ccosh and s_csinh. * math/complex.h: Add C++ protection. * math/libm-test.c (cexp_test): Correct a few bugs. (csinh_test): New function. (ccosh_test): New function. (cacos_test): New function. (cacosh_test): New function. (casinh_test): New function. (catanh_test): New function. (main): Add calls to csinh_test and ccosh_test. * misc/Makefile (tests): Add tst-tsearch. Add rule to link tst-tsearch against libm. * misc/tsearch.c: Rewritten to use Red-Black-Tree algorithm by Bernd Schmidt . * misc/tst-tsearch.c: New file. * stdio-common/bug5.c: Clear LD_LIBRARY_PATH environment variable before using system. * stdio-common/test-popen.c: Clear LD_LIBRARY_PATH environment variable before using popen. * sysdeps/libm-ieee754/s_cexp.c: Correct handling of special cases. * sysdeps/libm-ieee754/s_cexpf.c: Likewise. * sysdeps/libm-ieee754/s_cexpl.c: Likewise. * sysdeps/libm-i387/s_cexp.S: New file. ix87 specific implementation of complex exponential function. * sysdeps/libm-i387/s_cexpf.S: New file. * sysdeps/libm-i387/s_cexpl.S: New file. * sysdeps/libm-ieee754/s_ccosh.c: New file. Implementation of complex cosh function. * sysdeps/libm-ieee754/s_ccoshf.c: New file. * sysdeps/libm-ieee754/s_ccoshl.c: New file. * sysdeps/libm-ieee754/s_csinh.c: New file. Implementation of complex sinh function. * sysdeps/libm-ieee754/s_csinhf.c: New file. * sysdeps/libm-ieee754/s_csinhl.c: New file. * math/carg.c: New file. Generic implementatio of carg function. * math/cargf.c: New file. * math/cargl.c: New file. 1997-03-29 16:07 Ulrich Drepper * sysdeps/posix/system.c: Update copyright. 1997-03-29 04:18 Ulrich Drepper * elf/dl-error.c (_dl_catch_error): Add another argument which is passed to OPERATE. (_dl_receive_error): Likewise. * elf/link.h: Change prototypes for _dl_catch_error and _dl_receive_error to reflect above change. * elf/dl-deps.c: Don't use nested function. Call _dl_catch_error with additional argument with pointer to data. * elf/dlclose.c: Likewise. * elf/dlerror.c: Likewise. * elf/dlopen.c: Likewise. * elf/dlsym.c: Likewise. * elf/dlvsym.c: Likewise. * elf/rtld.c: Likewise. * nss/nsswitch.c: Likewise. Patch by Bernd Schmidt . 1997-03-28 21:14 Miguel de Icaza * elf/dl-error.c: Manually set up the values of "c", this avoids a call to memcpy and a zero 152 bytes structure. * sysdeps/sparc/dl-machine.h (elf_machine_rela): Test RTLD_BOOTSTRAP to avoid performing relative relocs on a second pass. * sysdeps/sparc/udiv_qrnnd.S: Make the code PIC aware. * sysdeps/unix/sysv/linux/sparc/Dist: Add kernel_stat.h and kernel_sigaction.h Add Linux/SPARC specific definitions. * sysdeps/unix/sysv/linux/sparc/fcntlbits.h: New file. * sysdeps/unix/sysv/linux/sparc/ioctls.h: New file. * sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h: New file. * sysdeps/unix/sysv/linux/sparc/kernel_stat.h: New file. * sysdeps/unix/sysv/linux/sparc/sigaction.h: New file. * sysdeps/unix/sysv/linux/sparc/signum.h: New file. * sysdeps/unix/sysv/linux/sparc/termbits.h: New file. 1997-03-28 13:06 Philip Blundell * sysdeps/posix/getaddrinfo.c (gaih_inet_serv): Use __getservbyname_r() not getservbyname(). (BROKEN_LIKE_POSIX): Define to 1 so we get strict POSIX behaviour. --- ChangeLog | 99 ++ PROJECTS | 16 +- elf/dl-deps.c | 45 +- elf/dl-error.c | 18 +- elf/dlclose.c | 13 +- elf/dlerror.c | 4 +- elf/dlopen.c | 30 +- elf/dlsym.c | 90 +- elf/dlvsym.c | 109 +- elf/link.h | 17 +- elf/rtld.c | 80 +- math/Makefile | 2 +- math/carg.c | 29 + math/cargf.c | 29 + math/cargl.c | 29 + math/complex.h | 8 +- math/libm-test.c | 768 ++++++++++- misc/Makefile | 8 +- misc/tsearch.c | 612 +++++++-- misc/tst-tsearch.c | 329 +++++ nss/nsswitch.c | 73 +- po/libc.pot | 1541 ++++++++++++++++------ stdio-common/bug5.c | 4 + stdio-common/test-popen.c | 30 +- sysdeps/libm-i387/s_cexp.S | 248 ++++ sysdeps/libm-i387/s_cexpf.S | 245 ++++ sysdeps/libm-i387/s_cexpl.S | 249 ++++ sysdeps/libm-ieee754/s_ccosh.c | 95 ++ sysdeps/libm-ieee754/s_ccoshf.c | 93 ++ sysdeps/libm-ieee754/s_ccoshl.c | 93 ++ sysdeps/libm-ieee754/s_cexp.c | 45 +- sysdeps/libm-ieee754/s_cexpf.c | 32 +- sysdeps/libm-ieee754/s_cexpl.c | 32 +- sysdeps/libm-ieee754/s_csinh.c | 102 ++ sysdeps/libm-ieee754/s_csinhf.c | 100 ++ sysdeps/libm-ieee754/s_csinhl.c | 100 ++ sysdeps/posix/getaddrinfo.c | 29 +- sysdeps/posix/system.c | 34 +- sysdeps/sparc/dl-machine.h | 7 +- sysdeps/sparc/udiv_qrnnd.S | 27 +- sysdeps/unix/sysv/linux/sparc/Dist | 2 + sysdeps/unix/sysv/linux/sparc/fcntlbits.h | 96 ++ sysdeps/unix/sysv/linux/sparc/ioctls.h | 39 + sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h | 12 + sysdeps/unix/sysv/linux/sparc/kernel_stat.h | 21 + sysdeps/unix/sysv/linux/sparc/sigaction.h | 52 + sysdeps/unix/sysv/linux/sparc/signum.h | 72 + sysdeps/unix/sysv/linux/sparc/termbits.h | 217 +++ 48 files changed, 5262 insertions(+), 763 deletions(-) create mode 100644 math/carg.c create mode 100644 math/cargf.c create mode 100644 math/cargl.c create mode 100644 misc/tst-tsearch.c create mode 100644 sysdeps/libm-i387/s_cexp.S create mode 100644 sysdeps/libm-i387/s_cexpf.S create mode 100644 sysdeps/libm-i387/s_cexpl.S create mode 100644 sysdeps/libm-ieee754/s_ccosh.c create mode 100644 sysdeps/libm-ieee754/s_ccoshf.c create mode 100644 sysdeps/libm-ieee754/s_ccoshl.c create mode 100644 sysdeps/libm-ieee754/s_csinh.c create mode 100644 sysdeps/libm-ieee754/s_csinhf.c create mode 100644 sysdeps/libm-ieee754/s_csinhl.c create mode 100644 sysdeps/unix/sysv/linux/sparc/fcntlbits.h create mode 100644 sysdeps/unix/sysv/linux/sparc/ioctls.h create mode 100644 sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h create mode 100644 sysdeps/unix/sysv/linux/sparc/kernel_stat.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sigaction.h create mode 100644 sysdeps/unix/sysv/linux/sparc/signum.h create mode 100644 sysdeps/unix/sysv/linux/sparc/termbits.h diff --git a/ChangeLog b/ChangeLog index f9dd5c7be1..f7d94565cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,102 @@ +1997-03-29 17:39 Ulrich Drepper + + * math/Makefile (routines): Add carg, s_ccosh and s_csinh. + + * math/complex.h: Add C++ protection. + + * math/libm-test.c (cexp_test): Correct a few bugs. + (csinh_test): New function. + (ccosh_test): New function. + (cacos_test): New function. + (cacosh_test): New function. + (casinh_test): New function. + (catanh_test): New function. + (main): Add calls to csinh_test and ccosh_test. + + * misc/Makefile (tests): Add tst-tsearch. + Add rule to link tst-tsearch against libm. + * misc/tsearch.c: Rewritten to use Red-Black-Tree algorithm by + Bernd Schmidt . + * misc/tst-tsearch.c: New file. + + * stdio-common/bug5.c: Clear LD_LIBRARY_PATH environment variable + before using system. + * stdio-common/test-popen.c: Clear LD_LIBRARY_PATH environment variable + before using popen. + + * sysdeps/libm-ieee754/s_cexp.c: Correct handling of special cases. + * sysdeps/libm-ieee754/s_cexpf.c: Likewise. + * sysdeps/libm-ieee754/s_cexpl.c: Likewise. + + * sysdeps/libm-i387/s_cexp.S: New file. ix87 specific implementation + of complex exponential function. + * sysdeps/libm-i387/s_cexpf.S: New file. + * sysdeps/libm-i387/s_cexpl.S: New file. + + * sysdeps/libm-ieee754/s_ccosh.c: New file. Implementation of + complex cosh function. + * sysdeps/libm-ieee754/s_ccoshf.c: New file. + * sysdeps/libm-ieee754/s_ccoshl.c: New file. + * sysdeps/libm-ieee754/s_csinh.c: New file. Implementation of + complex sinh function. + * sysdeps/libm-ieee754/s_csinhf.c: New file. + * sysdeps/libm-ieee754/s_csinhl.c: New file. + + * math/carg.c: New file. Generic implementatio of carg function. + * math/cargf.c: New file. + * math/cargl.c: New file. + +1997-03-29 16:07 Ulrich Drepper + + * sysdeps/posix/system.c: Update copyright. + +1997-03-29 04:18 Ulrich Drepper + + * elf/dl-error.c (_dl_catch_error): Add another argument which is + passed to OPERATE. + (_dl_receive_error): Likewise. + * elf/link.h: Change prototypes for _dl_catch_error and + _dl_receive_error to reflect above change. + * elf/dl-deps.c: Don't use nested function. Call _dl_catch_error + with additional argument with pointer to data. + * elf/dlclose.c: Likewise. + * elf/dlerror.c: Likewise. + * elf/dlopen.c: Likewise. + * elf/dlsym.c: Likewise. + * elf/dlvsym.c: Likewise. + * elf/rtld.c: Likewise. + * nss/nsswitch.c: Likewise. + Patch by Bernd Schmidt . + +1997-03-28 21:14 Miguel de Icaza + + * elf/dl-error.c: Manually set up the values of "c", this avoids a + call to memcpy and a zero 152 bytes structure. + + * sysdeps/sparc/dl-machine.h (elf_machine_rela): Test + RTLD_BOOTSTRAP to avoid performing relative relocs on a second + pass. + + * sysdeps/sparc/udiv_qrnnd.S: Make the code PIC aware. + + * sysdeps/unix/sysv/linux/sparc/Dist: Add kernel_stat.h and + kernel_sigaction.h + + Add Linux/SPARC specific definitions. + * sysdeps/unix/sysv/linux/sparc/fcntlbits.h: New file. + * sysdeps/unix/sysv/linux/sparc/ioctls.h: New file. + * sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h: New file. + * sysdeps/unix/sysv/linux/sparc/kernel_stat.h: New file. + * sysdeps/unix/sysv/linux/sparc/sigaction.h: New file. + * sysdeps/unix/sysv/linux/sparc/signum.h: New file. + * sysdeps/unix/sysv/linux/sparc/termbits.h: New file. + +1997-03-28 13:06 Philip Blundell + + * sysdeps/posix/getaddrinfo.c (gaih_inet_serv): Use + __getservbyname_r() not getservbyname(). + (BROKEN_LIKE_POSIX): Define to 1 so we get strict POSIX behaviour. + 1997-03-27 02:28 Ulrich Drepper * gmon/gmon.c (monstartup): Mark all messages. diff --git a/PROJECTS b/PROJECTS index dc0a6701e9..394b18efdf 100644 --- a/PROJECTS +++ b/PROJECTS @@ -110,32 +110,26 @@ contact **** Almost done! -[10] Write AVL-tree based tsearch() et.al. functions. Currently only - a very simple algorithm is used. - There is a public domain version but using this would cause problems - with the assignment. - - -[11] Extend regex and/or rx to work with wide characters and complete +[10] Extend regex and/or rx to work with wide characters and complete implementation of character class and collation class handling. It is planed to do a complete rewrite. -[12] Write access function for netmasks, bootparams, and automount +[11] Write access function for netmasks, bootparams, and automount databases for nss_files and nss_db module. The functions should be embedded in the nss scheme. This is not hard and not all services must be supported at once. -[13] Rewrite utmp/wtmp functions to use database functions. This is much +[12] Rewrite utmp/wtmp functions to use database functions. This is much better than the normal flat file format. **** There are plans for a new approach to this problem. Please contact bug-glibc@prep.ai.mit.edu before starting to work.) -[14] Several more or less small functions have to be written: +[13] Several more or less small functions have to be written: + tcgetid() and waitid() from XPG4.2 + grantpt(), ptsname(), unlockpt() from XPG4.2 @@ -145,7 +139,7 @@ contact More information are available on request. -[15] We need to write a library for on-the-fly transformation of streams +[14] We need to write a library for on-the-fly transformation of streams of text. In fact, this would be a recode-library (you know, GNU recode). This is needed in several places in the GNU libc and I already have rather concrete plans but so far no possibility to start this. diff --git a/elf/dl-deps.c b/elf/dl-deps.c index 7a6772979b..e2fd340822 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -22,6 +22,29 @@ #include #include +struct openaux_args +{ + /* The arguments to openaux. */ + struct link_map *map; + int trace_mode; + const char *strtab; + ElfW(Dyn) *d; + + /* The return value of openaux. */ + struct link_map *aux; +}; + +static void +openaux (void *a) +{ + struct openaux_args *args = (struct openaux_args *) a; + + args->aux = _dl_map_object (args->map, args->strtab + args->d->d_un.d_val, + (args->map->l_type == lt_executable + ? lt_library : args->map->l_type), + args->trace_mode); +} + void _dl_map_object_deps (struct link_map *map, struct link_map **preloads, unsigned int npreloads, @@ -75,27 +98,21 @@ _dl_map_object_deps (struct link_map *map, /* There is at least one auxiliary library specified. We try to load it, and if we can, use its symbols in preference to our own. But if we can't load it, we just silently ignore it. */ - const char *strtab + struct openaux_args args; + args.strtab = ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr); - ElfW(Dyn) *d; + args.map = map; + args.trace_mode = trace_mode; - for (d = map->l_ld; d->d_tag != DT_NULL; ++d) - if (d->d_tag == DT_AUXILIARY) + for (args.d = map->l_ld; args.d->d_tag != DT_NULL; ++args.d) + if (args.d->d_tag == DT_AUXILIARY) { - struct link_map *aux; - void openaux (void) - { - aux = _dl_map_object (map, strtab + d->d_un.d_val, - (map->l_type == lt_executable - ? lt_library : map->l_type), - trace_mode); - } char *errstring; const char *objname; - if (! _dl_catch_error (&errstring, &objname, openaux)) + if (! _dl_catch_error (&errstring, &objname, openaux, &args)) /* The auxiliary object is actually there. Use it as the first search element, even before MAP itself. */ - preload (aux); + preload (args.aux); } } diff --git a/elf/dl-error.c b/elf/dl-error.c index 263bd65eb0..e2565bb348 100644 --- a/elf/dl-error.c +++ b/elf/dl-error.c @@ -85,19 +85,25 @@ _dl_signal_error (int errcode, int _dl_catch_error (char **errstring, const char **objname, - void (*operate) (void)) + void (*operate) (void *), + void *args) { int errcode; - struct catch *old, c = { errstring: NULL, objname: NULL }; - /* We need not handle `receiver' since setting a `catch' is handle + struct catch *old, c; + /* We need not handle `receiver' since setting a `catch' is handled before it. */ + /* Some systems (.e.g, SPARC) handle constructors to local variables + inefficient. So we initialize `c' by hand. */ + c.errstring = NULL; + c.objname = NULL; + old = catch; errcode = setjmp (c.env); if (errcode == 0) { catch = &c; - (*operate) (); + (*operate) (args); catch = old; *errstring = NULL; *objname = NULL; @@ -112,7 +118,7 @@ _dl_catch_error (char **errstring, } void -_dl_receive_error (receiver_fct fct, void (*operate) (void)) +_dl_receive_error (receiver_fct fct, void (*operate) (void *), void *args) { struct catch *old_catch; receiver_fct old_receiver; @@ -124,7 +130,7 @@ _dl_receive_error (receiver_fct fct, void (*operate) (void)) catch = NULL; receiver = fct; - (*operate) (); + (*operate) (args); catch = old_catch; receiver = old_receiver; diff --git a/elf/dlclose.c b/elf/dlclose.c index 6a142119f7..d96ffc9cc1 100644 --- a/elf/dlclose.c +++ b/elf/dlclose.c @@ -20,13 +20,14 @@ #include #include +static void +dlclose_doit (void *handle) +{ + _dl_close (handle); +} + int dlclose (void *handle) { - void doit (void) - { - _dl_close (handle); - } - - return _dlerror_run (doit) ? -1 : 0; + return _dlerror_run (dlclose_doit, handle) ? -1 : 0; } diff --git a/elf/dlerror.c b/elf/dlerror.c index 9e55bc7c76..e2b1ac94a9 100644 --- a/elf/dlerror.c +++ b/elf/dlerror.c @@ -64,7 +64,7 @@ dlerror (void) } int -_dlerror_run (void (*operate) (void)) +_dlerror_run (void (*operate) (void *), void *args) { if (last_errstring != NULL) /* Free the error string from the last failed command. This can @@ -72,6 +72,6 @@ _dlerror_run (void (*operate) (void)) free (last_errstring); last_errcode = _dl_catch_error (&last_errstring, &last_object_name, - operate); + operate, args); return last_errstring != NULL; } diff --git a/elf/dlopen.c b/elf/dlopen.c index c2cf8cd58d..4963e9962e 100644 --- a/elf/dlopen.c +++ b/elf/dlopen.c @@ -21,15 +21,31 @@ #include #include -void * -dlopen (const char *file, int mode) +struct dlopen_args { + /* The arguments for dlopen_doit. */ + const char *file; + int mode; + /* The return value of dlopen_doit. */ struct link_map *new; +}; + - void doit (void) - { - new = _dl_open (file ?: "", mode); - } +static void +dlopen_doit (void *a) +{ + struct dlopen_args *args = (struct dlopen_args *) a; + + args->new = _dl_open (args->file ?: "", args->mode); +} + + +void * +dlopen (const char *file, int mode) +{ + struct dlopen_args args; + args.file = file; + args.mode = mode; - return _dlerror_run (doit) ? NULL : new; + return _dlerror_run (dlopen_doit, &args) ? NULL : args.new; } diff --git a/elf/dlsym.c b/elf/dlsym.c index d05619bfb4..1072f16ce1 100644 --- a/elf/dlsym.c +++ b/elf/dlsym.c @@ -22,47 +22,71 @@ #include #include - -void * -dlsym (void *handle, const char *name) +struct dlsym_args { - ElfW(Addr) caller = (ElfW(Addr)) __builtin_return_address (0); + /* The arguments to dlsym_doit. */ + void *handle; + const char *name; + struct r_found_version version; + ElfW(Addr) caller; + /* The return values of dlsym_doit. */ ElfW(Addr) loadbase; - const ElfW(Sym) *ref = NULL; - void doit (void) + const ElfW(Sym) *ref; +}; + + +static void +dlsym_doit (void *a) +{ + struct dlsym_args *args = (struct dlsym_args *) a; + args->ref = NULL; + + if (args->handle == NULL) + /* Search the global scope. */ + args->loadbase = _dl_lookup_symbol (args->name, &args->ref, + &(_dl_global_scope + ?: _dl_default_scope)[2], + NULL, 0); + else if (args->handle == RTLD_NEXT) { - if (handle == NULL) - /* Search the global scope. */ - loadbase = _dl_lookup_symbol - (name, &ref, &(_dl_global_scope ?: _dl_default_scope)[2], NULL, 0); - else if (handle == RTLD_NEXT) - { - struct link_map *l, *match; + struct link_map *l, *match; - /* Find the highest-addressed object that CALLER is not below. */ - match = NULL; - for (l = _dl_loaded; l; l = l->l_next) - if (caller >= l->l_addr && (!match || match->l_addr < l->l_addr)) - match = l; + /* Find the highest-addressed object that CALLER is not below. */ + match = NULL; + for (l = _dl_loaded; l; l = l->l_next) + if (args->caller >= l->l_addr && (!match || match->l_addr < l->l_addr)) + match = l; - if (! match) - _dl_signal_error (0, NULL, _("\ + if (! match) + _dl_signal_error (0, NULL, _("\ RTLD_NEXT used in code not dynamically loaded")); - l = match; - while (l->l_loader) - l = l->l_loader; + l = match; + while (l->l_loader) + l = l->l_loader; - loadbase = _dl_lookup_symbol_skip (name, &ref, &_dl_loaded, NULL, l); - } - else - { - /* Search the scope of the given object. */ - struct link_map *map = handle; - struct link_map *mapscope[2] = { map, NULL }; - loadbase = _dl_lookup_symbol (name, &ref, mapscope, map->l_name, 0); - } + args->loadbase = _dl_lookup_symbol_skip (args->name, &args->ref, + &_dl_loaded, NULL, l); } + else + { + /* Search the scope of the given object. */ + struct link_map *map = args->handle; + struct link_map *mapscope[2] = { map, NULL }; + args->loadbase = _dl_lookup_symbol (args->name, &args->ref, mapscope, + map->l_name, 0); + } +} + + +void * +dlsym (void *handle, const char *name) +{ + struct dlsym_args args; + args.caller = (ElfW(Addr)) __builtin_return_address (0); + args.handle = handle; + args.name = name; - return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value); + return (_dlerror_run (dlsym_doit, &args) + ? NULL : (void *) (args.loadbase + args.ref->st_value)); } diff --git a/elf/dlvsym.c b/elf/dlvsym.c index b3d4c1aeee..ca8e25d9df 100644 --- a/elf/dlvsym.c +++ b/elf/dlvsym.c @@ -24,57 +24,82 @@ #include -void * -__dlvsym (void *handle, const char *name, const char *version_str) +struct dlvsym_args { - ElfW(Addr) caller = (ElfW(Addr)) __builtin_return_address (0); - ElfW(Addr) loadbase; + /* The arguments to dlvsym_doit. */ + void *handle; + const char *name; struct r_found_version version; - const ElfW(Sym) *ref = NULL; - void doit (void) + ElfW(Addr) caller; + /* The return values of dlvsym_doit. */ + ElfW(Addr) loadbase; + const ElfW(Sym) *ref; +}; + + +static void +dlvsym_doit (void *a) +{ + struct dlvsym_args *args = (struct dlvsym_args *)a; + args->ref = NULL; + + if (args->handle == NULL) + /* Search the global scope. */ + args->loadbase = _dl_lookup_versioned_symbol (args->name, &args->ref, + &(_dl_global_scope + ?: _dl_default_scope)[2], + NULL, &args->version, 0); + else if (args->handle == RTLD_NEXT) { - if (handle == NULL) - /* Search the global scope. */ - loadbase = _dl_lookup_versioned_symbol - (name, &ref, &(_dl_global_scope ?: _dl_default_scope)[2], NULL, - &version, 0); - else if (handle == RTLD_NEXT) - { - struct link_map *l, *match; - - /* Find the highest-addressed object that CALLER is not below. */ - match = NULL; - for (l = _dl_loaded; l; l = l->l_next) - if (caller >= l->l_addr && (!match || match->l_addr < l->l_addr)) - match = l; - - if (! match) - _dl_signal_error (0, NULL, _("\ + struct link_map *l, *match; + + /* Find the highest-addressed object that CALLER is not below. */ + match = NULL; + for (l = _dl_loaded; l; l = l->l_next) + if (args->caller >= l->l_addr && (!match || match->l_addr < l->l_addr)) + match = l; + + if (! match) + _dl_signal_error (0, NULL, _("\ RTLD_NEXT used in code not dynamically loaded")); - l = match; - while (l->l_loader) - l = l->l_loader; - - loadbase = _dl_lookup_versioned_symbol_skip - (name, &ref, &_dl_loaded, NULL, &version, l); - } - else - { - /* Search the scope of the given object. */ - struct link_map *map = handle; - struct link_map *mapscope[2] = { map, NULL }; - loadbase = _dl_lookup_versioned_symbol - (name, &ref, mapscope, map->l_name, &version, 0); - } + l = match; + while (l->l_loader) + l = l->l_loader; + + args->loadbase = _dl_lookup_versioned_symbol_skip (args->name, + &args->ref, + &_dl_loaded, + NULL, &args->version, + l); + } + else + { + /* Search the scope of the given object. */ + struct link_map *map = args->handle; + struct link_map *mapscope[2] = { map, NULL }; + args->loadbase = _dl_lookup_versioned_symbol (args->name, &args->ref, + mapscope, map->l_name, + &args->version, 0); } +} + +void * +__dlvsym (void *handle, const char *name, const char *version_str) +{ + struct dlvsym_args args; + + args.handle = handle; + args.name = name; + args.caller = (ElfW(Addr)) __builtin_return_address (0); /* Compute hash value to the version string. */ - version.name = version_str; - version.hash = _dl_elf_hash (version_str); + args.version.name = version_str; + args.version.hash = _dl_elf_hash (version_str); /* We don't have a specific file where the symbol can be found. */ - version.filename = NULL; + args.version.filename = NULL; - return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value); + return (_dlerror_run (dlvsym_doit, &args) + ? NULL : (void *) (args.loadbase + args.ref->st_value)); } weak_alias (__dlvsym, dlvsym) diff --git a/elf/link.h b/elf/link.h index 3934aed8e2..0e58996b04 100644 --- a/elf/link.h +++ b/elf/link.h @@ -238,21 +238,26 @@ extern void _dl_signal_error (int errcode, error, *ERRSTRING is set to null. If there is an error, *ERRSTRING and *OBJECT are set to the strings passed to _dl_signal_error, and the error code passed is the return value. ERRSTRING if nonzero points to a - malloc'ed string which the caller has to free after use. */ + malloc'ed string which the caller has to free after use. + ARGS is passed as argument to OPERATE. */ extern int _dl_catch_error (char **errstring, const char **object, - void (*operate) (void)); + void (*operate) (void *), + void *args); /* Call OPERATE, receiving errors from `dl_signal_error'. Unlike `_dl_catch_error' the operation is resumed after the OPERATE - function returns. */ -extern void _dl_receive_error (receiver_fct fct, void (*operate) (void)); + function returns. + ARGS is passed as argument to OPERATE. */ +extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *), + void *args); /* Helper function for functions. Runs the OPERATE function via _dl_catch_error. Returns zero for success, nonzero for failure; and - arranges for `dlerror' to return the error details. */ -extern int _dlerror_run (void (*operate) (void)); + arranges for `dlerror' to return the error details. + ARGS is passed as argument to OPERATE. */ +extern int _dlerror_run (void (*operate) (void *), void *args); /* Open the shared object NAME and map in its segments. diff --git a/elf/rtld.c b/elf/rtld.c index d6bd516dfc..6f9737e060 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -140,6 +140,55 @@ _dl_start (void *arg) void _start (void); +/* Some helper functions. */ + +/* Arguments to relocate_doit. */ +struct relocate_args +{ + struct link_map *l; + int lazy; +}; + +struct map_args +{ + /* Argument to map_doit. */ + char *str; + /* Return value of map_doit. */ + struct link_map *main_map; +}; + +/* Arguments to version_check_doit. */ +struct version_check_args +{ + struct link_map *main_map; + int doexit; +}; + +static void +relocate_doit (void *a) +{ + struct relocate_args *args = (struct relocate_args *) a; + + _dl_relocate_object (args->l, _dl_object_relocation_scope (args->l), + args->lazy); +} + +static void +map_doit (void *a) +{ + struct map_args *args = (struct map_args *)a; + args->main_map = _dl_map_object (NULL, args->str, lt_library, 0); +} + +static void +version_check_doit (void *a) +{ + struct version_check_args *args = (struct version_check_args *)a; + if (_dl_check_all_versions (args->main_map, 1) && args->doexit) + /* We cannot start the application. Abort now. */ + _exit (1); +} + unsigned int _dl_skip_args; /* Nonzero if we were run directly. */ static void @@ -234,14 +283,13 @@ of this helper program; chances are you did not intend to run this program.\n", if (mode == verify) { - void doit (void) - { - main_map = _dl_map_object (NULL, _dl_argv[0], lt_library, 0); - } char *err_str = NULL; const char *obj_name __attribute__ ((unused)); + struct map_args args; - (void) _dl_catch_error (&err_str, &obj_name, doit); + args.str = _dl_argv[0]; + (void) _dl_catch_error (&err_str, &obj_name, map_doit, &args); + main_map = args.main_map; if (err_str != NULL) { free (err_str); @@ -469,14 +517,10 @@ of this helper program; chances are you did not intend to run this program.\n", /* Now let us see whether all libraries are available in the versions we need. */ { - void doit (void) - { - if (_dl_check_all_versions (main_map, 1) && mode == normal) - /* We cannot start the application. Abort now. */ - _exit (1); - } - - _dl_receive_error (print_missing_version, doit); + struct version_check_args args; + args.doexit = mode == normal; + args.main_map = main_map; + _dl_receive_error (print_missing_version, version_check_doit, &args); } if (mode != normal) @@ -535,11 +579,10 @@ of this helper program; chances are you did not intend to run this program.\n", else if (lazy >= 0) { /* We have to do symbol dependency testing. */ + struct relocate_args args; struct link_map *l; - void doit (void) - { - _dl_relocate_object (l, _dl_object_relocation_scope (l), lazy); - } + + args.lazy = lazy; l = _dl_loaded; while (l->l_next) @@ -548,7 +591,8 @@ of this helper program; chances are you did not intend to run this program.\n", { if (l != &_dl_rtld_map && l->l_opencount > 0) { - _dl_receive_error (print_unresolved, doit); + args.l = l; + _dl_receive_error (print_unresolved, relocate_doit, &args); *_dl_global_scope_end = NULL; } l = l->l_prev; diff --git a/math/Makefile b/math/Makefile index 2578dbf839..12967ffac5 100644 --- a/math/Makefile +++ b/math/Makefile @@ -49,7 +49,7 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \ w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt \ s_signbit s_fpclassify s_fmax s_fmin s_fdim s_nan s_trunc \ s_remquo s_log2 s_exp2 \ - conj cimag creal cabs s_cexp + conj cimag creal cabs carg s_cexp s_csinh s_ccosh libm-routines = $(libm-support) $(libm-calls) \ $(patsubst %_rf,%f_r,$(libm-calls:=f)) \ $(long-m-$(long-double-fcts)) diff --git a/math/carg.c b/math/carg.c new file mode 100644 index 0000000000..fb4dc8e52e --- /dev/null +++ b/math/carg.c @@ -0,0 +1,29 @@ +/* Compute argument of complex double value. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +double +__carg (__complex__ double x) +{ + return __atan2 (__imag__ x, __real__ x); +} +weak_alias (__carg, carg) diff --git a/math/cargf.c b/math/cargf.c new file mode 100644 index 0000000000..4b3c9f6d9a --- /dev/null +++ b/math/cargf.c @@ -0,0 +1,29 @@ +/* Compute argument of complex float value. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +float +__cargf (__complex__ float x) +{ + return __atan2f (__imag__ x, __real__ x); +} +weak_alias (__cargf, cargf) diff --git a/math/cargl.c b/math/cargl.c new file mode 100644 index 0000000000..4482da9dd0 --- /dev/null +++ b/math/cargl.c @@ -0,0 +1,29 @@ +/* Compute argument of complex long double value. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +long double +__cargl (__complex__ long double x) +{ + return __atan2l (__imag__ x, __real__ x); +} +weak_alias (__cargl, cargl) diff --git a/math/complex.h b/math/complex.h index 6fc5c1975f..42143531dc 100644 --- a/math/complex.h +++ b/math/complex.h @@ -21,7 +21,11 @@ */ #ifndef _COMPLEX_H + #define _COMPLEX_H 1 +#include + +__BEGIN_DECLS /* We might need to add support for more compilers here. But once ISO C 9X is out hopefully all maintained compilers will provide the data @@ -41,7 +45,7 @@ #define I _Imaginary_I -/* Optimization aids. This is not yet implemented in gcc and yonce it +/* Optimization aids. This is not yet implemented in gcc and once it is this will probably be available in a gcc header. */ #define CX_LIMITED_RANGE_ON #define CX_LIMITED_RANGE_OFF @@ -99,4 +103,6 @@ #undef __MATHDECL #undef __MATHCALL +__END_DECLS + #endif /* complex.h */ diff --git a/math/libm-test.c b/math/libm-test.c index a575cc66a8..85e4a4b065 100644 --- a/math/libm-test.c +++ b/math/libm-test.c @@ -1550,7 +1550,7 @@ cexp_test (void) check ("imag(cexp(+inf + 0i)) = 0", __imag__ result, 0); result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, minus_zero)); check_isinfp ("real(cexp(+inf - 0i)) = +inf", __real__ result); - check ("imag(cexp(+inf - 0i)) = 0", __imag__ result, 0); + check ("imag(cexp(+inf - 0i)) = -0", __imag__ result, minus_zero); result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, plus_zero)); check ("real(cexp(-inf + 0i)) = 0", __real__ result, 0); @@ -1574,11 +1574,11 @@ cexp_test (void) check ("imag(cexp(-inf + 4.0i)) = -0", __imag__ result, minus_zero); result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, 2.0)); - check_isinfn ("real(cexp(+inf + 2.0i)) = -0", __real__ result); - check_isinfp ("imag(cexp(+inf + 2.0i)) = 0", __imag__ result); + check_isinfn ("real(cexp(+inf + 2.0i)) = -inf", __real__ result); + check_isinfp ("imag(cexp(+inf + 2.0i)) = +inf", __imag__ result); result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, 4.0)); - check_isinfn ("real(cexp(+inf + 4.0i)) = -0", __real__ result); - check_isinfn ("imag(cexp(+inf + 4.0i)) = -0", __imag__ result); + check_isinfn ("real(cexp(+inf + 4.0i)) = -inf", __real__ result); + check_isinfn ("imag(cexp(+inf + 4.0i)) = -inf", __imag__ result); result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, plus_infty)); check_isinfp ("real(cexp(+inf + i inf)) = +inf", __real__ result); @@ -1592,7 +1592,7 @@ cexp_test (void) check ("imag(cexp(-inf + i inf)) = 0", __imag__ result, 0); result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, minus_infty)); check ("real(cexp(-inf - i inf)) = 0", __real__ result, 0); - check ("imag(cexp(-inf - i inf)) = 0", __imag__ result, 0); + check ("imag(cexp(-inf - i inf)) = -0", __imag__ result, minus_zero); result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, nan_value)); check ("real(cexp(-inf + i NaN)) = 0", __real__ result, 0); @@ -1621,6 +1621,760 @@ cexp_test (void) } +static void +csinh_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(csinh) (BUILD_COMPLEX (0.0, 0.0)); + check ("real(csinh(0 + 0i)) = 0", __real__ result, 0); + check ("imag(csinh(0 + 0i)) = 0", __imag__ result, 0); + result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, 0.0)); + check ("real(csinh(-0 + 0i)) = -0", __real__ result, minus_zero); + check ("imag(csinh(-0 + 0i)) = 0", __imag__ result, 0); + result = FUNC(csinh) (BUILD_COMPLEX (0.0, minus_zero)); + check ("real(csinh(0 - 0i)) = 0", __real__ result, 0); + check ("imag(csinh(0 - 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(csinh(-0 - 0i)) = -0", __real__ result, minus_zero); + check ("imag(csinh(-0 - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(csinh) (BUILD_COMPLEX (0.0, plus_infty)); + check ("real(csinh(0 + i Inf)) = 0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(0 + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, plus_infty)); + check ("real(csinh(-0 + i Inf)) = -0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(-0 + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (0.0, minus_infty)); + check ("real(csinh(0 - i Inf)) = 0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(0 - i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, minus_infty)); + check ("real(csinh(-0 - i Inf)) = -0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(-0 - i Inf)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, 0.0)); + check_isinfp ("real(csinh(+Inf + 0i)) = +Inf", __real__ result); + check ("imag(csinh(+Inf + 0i)) = 0", __imag__ result, 0); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, 0.0)); + check_isinfn ("real(csinh(-Inf + 0i)) = -Inf", __real__ result); + check ("imag(csinh(-Inf + 0i)) = 0", __imag__ result, 0); + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, minus_zero)); + check_isinfp ("real(csinh(+Inf - 0i)) = +Inf", __real__ result); + check ("imag(csinh(+Inf - 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, minus_zero)); + check_isinfn ("real(csinh(-Inf - 0i)) = -Inf", __real__ result); + check ("imag(csinh(-Inf - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(csinh(+Inf + i Inf)) = +-Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(+Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, plus_infty)); + check_isinfp ("real(csinh(-Inf + i Inf)) = +-Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(-Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(csinh(Inf - i Inf)) = +-Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(Inf - i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, minus_infty)); + check_isinfp ("real(csinh(-Inf - i Inf)) = -Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(-Inf - i Inf)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, 4.625)); + check_isinfn ("real(csinh(+Inf + i4.625)) = -Inf", __real__ result); + check_isinfn ("imag(csinh(+Inf + i4.625)) = -Inf", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, 4.625)); + check_isinfp ("real(csinh(-Inf + i4.625)) = +Inf", __real__ result); + check_isinfn ("imag(csinh(-Inf + i4.625)) = -Inf", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, -4.625)); + check_isinfn ("real(csinh(+Inf - i4.625)) = -Inf", __real__ result); + check_isinfp ("imag(csinh(+Inf - i4.625)) = +Inf", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, -4.625)); + check_isinfp ("real(csinh(-Inf - i4.625)) = +Inf", __real__ result); + check_isinfp ("imag(csinh(-Inf - i4.625)) = +Inf", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (6.75, plus_infty)); + check_isnan ("real(csinh(6.75 + i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(6.75 + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (-6.75, plus_infty)); + check_isnan ("real(csinh(-6.75 + i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(-6.75 + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (6.75, minus_infty)); + check_isnan ("real(csinh(6.75 - i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(6.75 - i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (-6.75, minus_infty)); + check_isnan ("real(csinh(-6.75 - i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(-6.75 - i Inf)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (0.0, nan_value)); + check ("real(csinh(0 + i NaN)) = 0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, nan_value)); + check ("real(csinh(-0 + i NaN)) = -0", FUNC(fabs) (__real__ result), 0); + check_isnan ("imag(csinh(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isinfp ("real(csinh(+Inf + i NaN)) = +-Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isinfp ("real(csinh(-Inf + i NaN)) = +-Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(csinh(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (9.0, nan_value)); + check_isnan ("real(csinh(9.0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(csinh(9.0 + i NaN)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (-9.0, nan_value)); + check_isnan ("real(csinh(-9.0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(csinh(-9.0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, 0.0)); + check_isnan ("real(csinh(NaN + i0)) = NaN", __real__ result); + check ("imag(csinh(NaN + i0)) = NaN", __imag__ result, 0.0); + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, minus_zero)); + check_isnan ("real(csinh(NaN - i0)) = NaN", __real__ result); + check ("imag(csinh(NaN - i0)) = NaN", __imag__ result, minus_zero); + + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, 10.0)); + check_isnan ("real(csinh(NaN + i10)) = NaN", __real__ result); + check_isnan ("imag(csinh(NaN + i10)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, -10.0)); + check_isnan ("real(csinh(NaN - i10)) = NaN", __real__ result); + check_isnan ("imag(csinh(NaN - i10)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isnan ("real(csinh(NaN + i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(NaN + i Inf)) = NaN", __imag__ result); + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isnan ("real(csinh(NaN - i Inf)) = NaN", __real__ result); + check_isnan ("imag(csinh(NaN - i Inf)) = NaN", __imag__ result); + + result = FUNC(csinh) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(csinh(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(csinh(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void +ccosh_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(ccosh) (BUILD_COMPLEX (0.0, 0.0)); + check ("real(ccosh(0 + 0i)) = 0", __real__ result, 1.0); + check ("imag(ccosh(0 + 0i)) = 0", __imag__ result, 0); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, 0.0)); + check ("real(ccosh(-0 + 0i)) = -0", __real__ result, 1.0); + check ("imag(ccosh(-0 + 0i)) = 0", __imag__ result, 0); + result = FUNC(ccosh) (BUILD_COMPLEX (0.0, minus_zero)); + check ("real(ccosh(0 - 0i)) = 0", __real__ result, 1.0); + check ("imag(ccosh(0 - 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(ccosh(-0 - 0i)) = -0", __real__ result, 1.0); + check ("imag(ccosh(-0 - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(ccosh) (BUILD_COMPLEX (0.0, plus_infty)); + check_isnan ("real(ccosh(0 + i Inf)) = NaN", __real__ result); + check ("imag(ccosh(0 + i Inf)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, plus_infty)); + check_isnan ("real(ccosh(-0 + i Inf)) = NaN", __real__ result); + check ("imag(ccosh(-0 + i Inf)) = -0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccosh) (BUILD_COMPLEX (0.0, minus_infty)); + check_isnan ("real(ccosh(0 - i Inf)) = NaN", __real__ result); + check ("imag(ccosh(0 - i Inf)) = 0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, minus_infty)); + check_isnan ("real(ccosh(-0 - i Inf)) = NaN", __real__ result); + check ("imag(ccosh(-0 - i Inf)) = -0", FUNC(fabs) (__imag__ result), 0); + + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, 0.0)); + check_isinfp ("real(ccosh(+Inf + 0i)) = +Inf", __real__ result); + check ("imag(ccosh(+Inf + 0i)) = 0", __imag__ result, 0); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, 0.0)); + check_isinfp ("real(ccosh(-Inf + 0i)) = +Inf", __real__ result); + check ("imag(ccosh(-Inf + 0i)) = 0", __imag__ result, 0); + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, minus_zero)); + check_isinfp ("real(ccosh(+Inf - 0i)) = +Inf", __real__ result); + check ("imag(ccosh(+Inf - 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, minus_zero)); + check_isinfp ("real(ccosh(-Inf - 0i)) = +Inf", __real__ result); + check ("imag(ccosh(-Inf - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(ccosh(+Inf + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(+Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, plus_infty)); + check_isinfp ("real(ccosh(-Inf + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(-Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(ccosh(Inf - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(Inf - i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, minus_infty)); + check_isinfp ("real(ccosh(-Inf - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(-Inf - i Inf)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, 4.625)); + check_isinfn ("real(ccosh(+Inf + i4.625)) = -Inf", __real__ result); + check_isinfn ("imag(ccosh(+Inf + i4.625)) = -Inf", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, 4.625)); + check_isinfn ("real(ccosh(-Inf + i4.625)) = -Inf", __real__ result); + check_isinfn ("imag(ccosh(-Inf + i4.625)) = -Inf", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, -4.625)); + check_isinfn ("real(ccosh(+Inf - i4.625)) = -Inf", __real__ result); + check_isinfp ("imag(ccosh(+Inf - i4.625)) = +Inf", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, -4.625)); + check_isinfn ("real(ccosh(-Inf - i4.625)) = -Inf", __real__ result); + check_isinfp ("imag(ccosh(-Inf - i4.625)) = +Inf", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (6.75, plus_infty)); + check_isnan ("real(ccosh(6.75 + i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(6.75 + i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (-6.75, plus_infty)); + check_isnan ("real(ccosh(-6.75 + i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(-6.75 + i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (6.75, minus_infty)); + check_isnan ("real(ccosh(6.75 - i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(6.75 - i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (-6.75, minus_infty)); + check_isnan ("real(ccosh(-6.75 - i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(-6.75 - i Inf)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (0.0, nan_value)); + check_isnan ("real(ccosh(0 + i NaN)) = NaN", __real__ result); + check ("imag(ccosh(0 + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(ccosh(-0 + i NaN)) = NaN", __real__ result); + check ("imag(ccosh(-0 + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0); + + result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isinfp ("real(ccosh(+Inf + i NaN)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isinfp ("real(ccosh(-Inf + i NaN)) = +Inf", __real__ result); + check_isnan ("imag(ccosh(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (9.0, nan_value)); + check_isnan ("real(ccosh(9.0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccosh(9.0 + i NaN)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (-9.0, nan_value)); + check_isnan ("real(ccosh(-9.0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccosh(-9.0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, 0.0)); + check_isnan ("real(ccosh(NaN + i0)) = NaN", __real__ result); + check ("imag(ccosh(NaN + i0)) = NaN", __imag__ result, 0.0); + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, minus_zero)); + check_isnan ("real(ccosh(NaN - i0)) = NaN", __real__ result); + check ("imag(ccosh(NaN - i0)) = NaN", __imag__ result, minus_zero); + + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, 10.0)); + check_isnan ("real(ccosh(NaN + i10)) = NaN", __real__ result); + check_isnan ("imag(ccosh(NaN + i10)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, -10.0)); + check_isnan ("real(ccosh(NaN - i10)) = NaN", __real__ result); + check_isnan ("imag(ccosh(NaN - i10)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isnan ("real(ccosh(NaN + i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(NaN + i Inf)) = NaN", __imag__ result); + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isnan ("real(ccosh(NaN - i Inf)) = NaN", __real__ result); + check_isnan ("imag(ccosh(NaN - i Inf)) = NaN", __imag__ result); + + result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(ccosh(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccosh(NaN + i NaN)) = NaN", __imag__ result); +} + + +#if 0 +/* Enable these tests as soon as the functions are available. */ +static void +cacos_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(cacos) (BUILD_COMPLEX (0, 0)); + check ("real(cacos(0 + i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(cacos(0 + i0)) = -0", __imag__ result, minus_zero); + result = FUNC(cacos) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(cacos(-0 + i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(cacos(-0 + i0)) = -0", __imag__ result, minus_zero); + result = FUNC(cacos) (BUILD_COMPLEX (0, minus_zero)); + check ("real(cacos(0 - i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(cacos(0 - i0)) = 0", __imag__ result, 0); + result = FUNC(cacos) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(cacos(-0 - i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(cacos(-0 - i0)) = 0", __imag__ result, 0); + + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, plus_infty)); + check ("real(cacos(-Inf + i Inf)) = 3*pi/4", __real__ result, M_PI - M_PI_4); + check_isinfn ("imag(cacos(-Inf + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, minus_infty)); + check ("real(cacos(-Inf - i Inf)) = 3*pi/4", __real__ result, M_PI - M_PI_4); + check_isinfp ("imag(cacos(-Inf - i Inf)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, plus_infty)); + check ("real(cacos(+Inf + i Inf)) = pi/4", __real__ result, M_PI_4); + check_isinfn ("imag(cacos(+Inf + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, minus_infty)); + check ("real(cacos(+Inf - i Inf)) = pi/4", __real__ result, M_PI_4); + check_isinfp ("imag(cacos(+Inf - i Inf)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (-10.0, plus_infty)); + check ("real(cacos(-10.0 + i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfn ("imag(cacos(-10.0 + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (-10.0, minus_infty)); + check ("real(cacos(-10.0 - i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfp ("imag(cacos(-10.0 - i Inf)) = +Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (0, plus_infty)); + check ("real(cacos(0 + i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfn ("imag(cacos(0 + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (0, minus_infty)); + check ("real(cacos(0 - i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfp ("imag(cacos(0 - i Inf)) = +Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (0.1, plus_infty)); + check ("real(cacos(0.1 + i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfn ("imag(cacos(0.1 + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (0.1, minus_infty)); + check ("real(cacos(0.1 - i Inf)) = pi/2", __real__ result, M_PI_2); + check_isinfp ("imag(cacos(0.1 - i Inf)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, 0)); + check ("real(cacos(-Inf + i0)) = pi", __real__ result, M_PI); + check_isinfn ("imag(cacos(-Inf + i0)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, minus_zero)); + check ("real(cacos(-Inf - i0)) = pi", __real__ result, M_PI); + check_isinfp ("imag(cacos(-Inf - i0)) = +Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, 100)); + check ("real(cacos(-Inf + i100)) = pi", __real__ result, M_PI); + check_isinfn ("imag(cacos(-Inf + i100)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, -100)); + check ("real(cacos(-Inf - i100)) = pi", __real__ result, M_PI); + check_isinfp ("imag(cacos(-Inf - i100)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, 0)); + check ("real(cacos(+Inf + i0)) = 0", __real__ result, 0); + check_isinfn ("imag(cacos(+Inf + i0)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, minus_zero)); + check ("real(cacos(+Inf - i0)) = 0", __real__ result, 0); + check_isinfp ("imag(cacos(+Inf - i0)) = +Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, 0.5)); + check ("real(cacos(+Inf + i0.5)) = 0", __real__ result, 0); + check_isinfn ("imag(cacos(+Inf + i0.5)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, -0.5)); + check ("real(cacos(+Inf - i0.5)) = 0", __real__ result, 0); + check_isinfp ("imag(cacos(+Inf - i0.5)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isnan ("real(cacos(+Inf + i NaN)) = NaN", __real__ result); + check_isinfp ("imag(cacos(+Inf + i NaN)) = +-Inf", + FUNC(fabs) (__imag__ result)); + result = FUNC(cacos) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isnan ("real(cacos(-Inf + i NaN)) = NaN", __real__ result); + check_isinfp ("imag(cacos(-Inf + i NaN)) = +-Inf", + FUNC(fabs) (__imag__ result)); + + result = FUNC(cacos) (BUILD_COMPLEX (0, nan_value)); + check ("real(cacos(0 + i NaN)) = pi/2", __real__ result, M_PI_2); + check_isnan ("imag(cacos(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (minus_zero, nan_value)); + check ("real(cacos(-0 + i NaN)) = pi/2", __real__ result, M_PI_2); + check_isnan ("imag(cacos(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isnan ("real(cacos(NaN + i Inf)) = NaN", __real__ result); + check_isinfn ("imag(cacos(NaN + i Inf)) = -Inf", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isnan ("real(cacos(NaN - i Inf)) = NaN", __real__ result); + check_isinfp ("imag(cacos(NaN - i Inf)) = +Inf", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (10.5, nan_value)); + check_isnan ("real(cacos(10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacos(10.5 + i NaN)) = NaN", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(cacos(-10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacos(-10.5 + i NaN)) = NaN", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (nan_value, 0.75)); + check_isnan ("real(cacos(NaN + i0.75)) = NaN", __real__ result); + check_isnan ("imag(cacos(NaN + i0.75)) = NaN", __imag__ result); + result = FUNC(cacos) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(cacos(NaN - i0.75)) = NaN", __real__ result); + check_isnan ("imag(cacos(NaN - i0.75)) = NaN", __imag__ result); + + result = FUNC(cacos) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(cacos(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacos(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void +cacosh_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(cacosh) (BUILD_COMPLEX (0, 0)); + check ("real(cacosh(0 + i0)) = 0", __real__ result, 0); + check ("imag(cacosh(0 + i0)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(cacosh(-0 + i0)) = 0", __real__ result, 0); + check ("imag(cacosh(-0 + i0)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (0, minus_zero)); + check ("real(cacosh(0 - i0)) = 0", __real__ result, 0); + check ("imag(cacosh(0 - i0)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(cacosh(-0 - i0)) = 0", __real__ result, 0); + check ("imag(cacosh(-0 - i0)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, plus_infty)); + check_isinfp ("real(cacosh(-Inf + i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf + i Inf)) = 3*pi/4", __imag__ result, + M_PI - M_PI_4); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, minus_infty)); + check_isinfp ("real(cacosh(-Inf - i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf - i Inf)) = -3*pi/4", __imag__ result, + M_PI_4 - M_PI); + + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(cacosh(+Inf + i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf + i Inf)) = pi/4", __imag__ result, M_PI_4); + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(cacosh(+Inf - i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf - i Inf)) = -pi/4", __imag__ result, -M_PI_4); + + result = FUNC(cacosh) (BUILD_COMPLEX (-10.0, plus_infty)); + check_isinfp ("real(cacosh(-10.0 + i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(-10.0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (-10.0, minus_infty)); + check_isinfp ("real(cacosh(-10.0 - i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(-10.0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (0, plus_infty)); + check_isinfp ("real(cacosh(0 + i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (0, minus_infty)); + check_isinfp ("real(cacosh(0 - i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (0.1, plus_infty)); + check_isinfp ("real(cacosh(0.1 + i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(0.1 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(cacosh) (BUILD_COMPLEX (0.1, minus_infty)); + check_isinfp ("real(cacosh(0.1 - i Inf)) = +Inf", __real__ result); + check ("imag(cacosh(0.1 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, 0)); + check_isinfp ("real(cacosh(-Inf + i0)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf + i0)) = pi", __imag__ result, M_PI); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, minus_zero)); + check_isinfp ("real(cacosh(-Inf - i0)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf - i0)) = -pi", __imag__ result, -M_PI); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, 100)); + check_isinfp ("real(cacosh(-Inf + i100)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf + i100)) = pi", __imag__ result, M_PI); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, -100)); + check_isinfp ("real(cacosh(-Inf - i100)) = +Inf", __real__ result); + check ("imag(cacosh(-Inf - i100)) = -pi", __imag__ result, -M_PI); + + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, 0)); + check_isinfp ("real(cacosh(+Inf + i0)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf + i0)) = 0", __imag__ result, 0); + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, minus_zero)); + check_isinfp ("real(cacosh(+Inf - i0)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, 0.5)); + check_isinfp ("real(cacosh(+Inf + i0.5)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf + i0.5)) = 0", __imag__ result, 0); + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, -0.5)); + check_isinfp ("real(cacosh(+Inf - i0.5)) = +Inf", __real__ result); + check ("imag(cacosh(+Inf - i0.5)) = -0", __imag__ result, minus_zero); + + result = FUNC(cacosh) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isinfp ("real(cacosh(+Inf + i NaN)) = +Inf", __real__ result); + check_isnan ("imag(cacosh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isinfp ("real(cacosh(-Inf + i NaN)) = +Inf", __real__ result); + check_isnan ("imag(cacosh(-Inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(cacosh) (BUILD_COMPLEX (0, nan_value)); + check_isnan ("real(cacosh(0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacosh(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(cacosh) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(cacosh(-0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacosh(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isinfp ("real(cacosh(NaN + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(cacosh(NaN + i Inf)) = NaN", __imag__ result); + result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isinfp ("real(cacosh(NaN - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(cacosh(NaN - i Inf)) = NaN", __imag__ result); + + result = FUNC(cacosh) (BUILD_COMPLEX (10.5, nan_value)); + check_isnan ("real(cacosh(10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacosh(10.5 + i NaN)) = NaN", __imag__ result); + result = FUNC(cacosh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(cacosh(-10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacosh(-10.5 + i NaN)) = NaN", __imag__ result); + + result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, 0.75)); + check_isnan ("real(cacosh(NaN + i0.75)) = NaN", __real__ result); + check_isnan ("imag(cacosh(NaN + i0.75)) = NaN", __imag__ result); + result = FUNC(cacosh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(cacosh(NaN - i0.75)) = NaN", __real__ result); + check_isnan ("imag(cacosh(NaN - i0.75)) = NaN", __imag__ result); + + result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(cacosh(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cacosh(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void +casinh_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(casinh) (BUILD_COMPLEX (0, 0)); + check ("real(casinh(0 + i0)) = 0", __real__ result, 0); + check ("imag(casinh(0 + i0)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(casinh(-0 + i0)) = -0", __real__ result, minus_zero); + check ("imag(casinh(-0 + i0)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (0, minus_zero)); + check ("real(casinh(0 - i0)) = 0", __real__ result, 0); + check ("imag(casinh(0 - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(casinh(-0 - i0)) = -0", __real__ result, minus_zero); + check ("imag(casinh(-0 - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(casinh(+Inf + i Inf)) = +Inf", __real__ result); + check ("imag(casinh(+Inf + i Inf)) = pi/4", __imag__ result, M_PI_4); + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(casinh(+Inf - i Inf)) = +Inf", __real__ result); + check ("imag(casinh(+Inf - i Inf)) = -pi/4", __imag__ result, -M_PI_4); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, plus_infty)); + check_isinfn ("real(casinh(-Inf + i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-Inf + i Inf)) = pi/4", __imag__ result, M_PI_4); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, minus_infty)); + check_isinfn ("real(casinh(-Inf - i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-Inf - i Inf)) = -pi/4", __imag__ result, -M_PI_4); + + result = FUNC(casinh) (BUILD_COMPLEX (-10.0, plus_infty)); + check_isinfn ("real(casinh(-10.0 + i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-10.0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (-10.0, minus_infty)); + check_isinfn ("real(casinh(-10.0 - i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-10.0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (0, plus_infty)); + check_isinfp ("real(casinh(0 + i Inf)) = +Inf", __real__ result); + check ("imag(casinh(0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (0, minus_infty)); + check_isinfp ("real(casinh(0 - i Inf)) = +Inf", __real__ result); + check ("imag(casinh(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (0.1, plus_infty)); + check_isinfp ("real(casinh(0.1 + i Inf)) = +Inf", __real__ result); + check ("imag(casinh(0.1 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (0.1, minus_infty)); + check_isinfp ("real(casinh(0.1 - i Inf)) = +Inf", __real__ result); + check ("imag(casinh(0.1 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, 0)); + check_isinfn ("real(casinh(-Inf + i0)) = -Inf", __real__ result); + check ("imag(casinh(-Inf + i0)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, minus_zero)); + check_isinfn ("real(casinh(-Inf - i0)) = -Inf", __real__ result); + check ("imag(casinh(-Inf - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, 100)); + check_isinfn ("real(casinh(-Inf + i100)) = -Inf", __real__ result); + check ("imag(casinh(-Inf + i100)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, -100)); + check_isinfn ("real(casinh(-Inf - i100)) = -Inf", __real__ result); + check ("imag(casinh(-Inf - i100)) = -0", __imag__ result, minus_zero); + + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, 0)); + check_isinfp ("real(casinh(+Inf + i0)) = +Inf", __real__ result); + check ("imag(casinh(+Inf + i0)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, minus_zero)); + check_isinfp ("real(casinh(+Inf - i0)) = +Inf", __real__ result); + check ("imag(casinh(+Inf - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, 0.5)); + check_isinfp ("real(casinh(+Inf + i0.5)) = +Inf", __real__ result); + check ("imag(casinh(+Inf + i0.5)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, -0.5)); + check_isinfp ("real(casinh(+Inf - i0.5)) = +Inf", __real__ result); + check ("imag(casinh(+Inf - i0.5)) = -0", __imag__ result, minus_zero); + + result = FUNC(casinh) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isinfp ("real(casinh(+Inf + i NaN)) = +Inf", __real__ result); + check_isnan ("imag(casinh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(casinh) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isinfn ("real(casinh(-Inf + i NaN)) = -Inf", __real__ result); + check_isnan ("imag(casinh(-Inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, 0)); + check_isnan ("real(casinh(NaN + i0)) = NaN", __real__ result); + check ("imag(casinh(NaN + i0)) = 0", __imag__ resul, 0); + result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(casinh(NaN - i0)) = NaN", __real__ result); + check ("imag(casinh(NaN - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isinfp ("real(casinh(NaN + i Inf)) = +Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(casinh(NaN + i Inf)) = NaN", __imag__ result); + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isinfp ("real(casinh(NaN - i Inf)) = +Inf", + FUNC(fabs) (__real__ result)); + check_isnan ("imag(casinh(NaN - i Inf)) = NaN", __imag__ result); + + result = FUNC(casinh) (BUILD_COMPLEX (10.5, nan_value)); + check_isnan ("real(casinh(10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casinh(10.5 + i NaN)) = NaN", __imag__ result); + result = FUNC(casinh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(casinh(-10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casinh(-10.5 + i NaN)) = NaN", __imag__ result); + + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, 0.75)); + check_isnan ("real(casinh(NaN + i0.75)) = NaN", __real__ result); + check_isnan ("imag(casinh(NaN + i0.75)) = NaN", __imag__ result); + result = FUNC(casinh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(casinh(NaN - i0.75)) = NaN", __real__ result); + check_isnan ("imag(casinh(NaN - i0.75)) = NaN", __imag__ result); + + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(casinh(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casinh(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void +catanh_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(catanh) (BUILD_COMPLEX (0, 0)); + check ("real(catanh(0 + i0)) = 0", __real__ result, 0); + check ("imag(catanh(0 + i0)) = 0", __imag__ result, 0); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(catanh(-0 + i0)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-0 + i0)) = 0", __imag__ result, 0); + result = FUNC(catanh) (BUILD_COMPLEX (0, minus_zero)); + check ("real(catanh(0 - i0)) = 0", __real__ result, 0); + check ("imag(catanh(0 - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(catanh(-0 - i0)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-0 - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, plus_infty)); + check ("real(catanh(+Inf + i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, minus_infty)); + check ("real(catanh(+Inf - i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, plus_infty)); + check ("real(catanh(-Inf + i Inf)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, minus_infty)); + check ("real(catanh(-Inf - i Inf)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(catanh) (BUILD_COMPLEX (-10.0, plus_infty)); + check ("real(catanh(-10.0 + i Inf)) = -0", __real__ result, -minus_zero); + check ("imag(catanh(-10.0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (-10.0, minus_infty)); + check ("real(catanh(-10.0 - i Inf)) = -0", __real__ result, minus_infty); + check ("imag(catanh(-10.0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (0, plus_infty)); + check ("real(catanh(0 + i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (0, minus_infty)); + check ("real(catanh(0 - i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (0.1, plus_infty)); + check ("real(catanh(0.1 + i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(0.1 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (0.1, minus_infty)); + check ("real(catanh(0.1 - i Inf)) = 0", __real__ result, 0); + check ("imag(catanh(0.1 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, 0)); + check ("real(catanh(-Inf + i0)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf + i0)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, minus_zero)); + check ("real(catanh(-Inf - i0)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf - i0)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, 100)); + check ("real(catanh(-Inf + i100)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf + i100)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, -100)); + check ("real(catanh(-Inf - i100)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-Inf - i100)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, 0)); + check ("real(catanh(+Inf + i0)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf + i0)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, minus_zero)); + check ("real(catanh(+Inf - i0)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf - i0)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, 0.5)); + check ("real(catanh(+Inf + i0.5)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf + i0.5)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, -0.5)); + check ("real(catanh(+Inf - i0.5)) = 0", __real__ result, 0); + check ("imag(catanh(+Inf - i0.5)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(catanh) (BUILD_COMPLEX (0, nan_value)); + check ("real(catanh(0 + i NaN)) = 0", __real__ result, 0); + check_isnan ("imag(catanh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, nan_value)); + check ("real(catanh(-0 + i NaN)) = -0", __real__ result, minus_zero); + check_isnan ("imag(catanh(-Inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, nan_value)); + check ("real(catanh(+Inf + i NaN)) = 0", __real__ result, 0); + check_isnan ("imag(catanh(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(catanh) (BUILD_COMPLEX (minus_infty, nan_value)); + check ("real(catanh(-Inf + i NaN)) = -0", __real__ result, minus_zero); + check_isnan ("imag(catanh(-Inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, 0)); + check_isnan ("real(catanh(NaN + i0)) = NaN", __real__ result); + check_isnan ("imag(catanh(NaN + i0)) = NaN", __imag__ resul); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(catanh(NaN - i0)) = NaN", __real__ result); + check_isnan ("imag(catanh(NaN - i0)) = NaN", __imag__ result); + + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, plus_infty)); + check ("real(catanh(NaN + i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); + check ("imag(catanh(NaN + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, minus_infty)); + check ("real(catanh(NaN - i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); + check ("imag(catanh(NaN - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + + result = FUNC(catanh) (BUILD_COMPLEX (10.5, nan_value)); + check_isnan ("real(catanh(10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catanh(10.5 + i NaN)) = NaN", __imag__ result); + result = FUNC(catanh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(catanh(-10.5 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catanh(-10.5 + i NaN)) = NaN", __imag__ result); + + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, 0.75)); + check_isnan ("real(catanh(NaN + i0.75)) = NaN", __real__ result); + check_isnan ("imag(catanh(NaN + i0.75)) = NaN", __imag__ result); + result = FUNC(catanh) (BUILD_COMPLEX (-10.5, nan_value)); + check_isnan ("real(catanh(NaN - i0.75)) = NaN", __real__ result); + check_isnan ("imag(catanh(NaN - i0.75)) = NaN", __imag__ result); + + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(catanh(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catanh(NaN + i NaN)) = NaN", __imag__ result); +} +#endif + + static void inverse_func_pair_test (const char *test_name, mathfunc f1, mathfunc inverse, @@ -1943,6 +2697,8 @@ main (int argc, char *argv[]) remquo_test (); #endif cexp_test (); + csinh_test (); + ccosh_test (); identities (); inverse_functions (); diff --git a/misc/Makefile b/misc/Makefile index b789659eaa..e2db14daa0 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -64,7 +64,7 @@ install-lib := libbsd-compat.a libg.a non-lib.a := libbsd-compat.a gpl2lgpl := error.c error.h -tests := tst-dirname +tests := tst-dirname tst-tsearch include ../Rules @@ -77,3 +77,9 @@ $(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib) CFLAGS-init-misc.c = -fkeep-inline-functions + +ifeq ($(build-shared),yes) +$(objpfx)tst-tsearch: $(common-objpfx)math/libm.so$(libm.so-version) +else +$(objpfx)tst-tsearch: $(common-objpfx)math/libm.a +endif diff --git a/misc/tsearch.c b/misc/tsearch.c index 6af6536a72..466536bf34 100644 --- a/misc/tsearch.c +++ b/misc/tsearch.c @@ -1,5 +1,6 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Bernd Schmidt , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -16,175 +17,584 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Tree search generalized from Knuth (6.2.2) Algorithm T just like - the AT&T man page says. - - The node_t structure is for internal use only, lint doesn't grok it. - - Written by reading the System V Interface Definition, not the code. +/* Tree search for red/black trees. + The algorithm for adding nodes is taken from one of the many "Algorithms" + books by Robert Sedgewick, although the implementation differs. + The algorithm for deleting nodes can probably be found in a book named + "Introduction to Algorithms" by Cormen/Leiserson/Rivest. At least that's + the book that my professor took most algorithms from during the "Data + Structures" course... Totally public domain. */ -/*LINTLIBRARY*/ + +/* Red/black trees are binary trees in which the edges are colored either red + or black. They have the following properties: + 1. The number of black edges on every path from the root to a leaf is + constant. + 2. No two red edges are adjacent. + Therefore there is an upper bound on the length of every path, it's + O(log n) where n is the number of nodes in the tree. No path can be longer + than 1+2*P where P is the length of the shortest path in the tree. + Useful for the implementation: + 3. If one of the children of a node is NULL, then the other one is red + (if it exists). + + In the implementation, not the edges are colored, but the nodes. The color + interpreted as the color of the edge leading to this node. The color is + meaningless for the root node, but we color the root node black for + convenience. All added nodes are red initially. + + Adding to a red/black tree is rather easy. The right place is searched + with a usual binary tree search. Additionally, whenever a node N is + reached that has two red successors, the successors are colored black and + the node itself colored red. This moves red edges up the tree where they + pose less of a problem once we get to really insert the new node. Changing + N's color to red may violate rule 2, however, so rotations may become + necessary to restore the invariants. Adding a new red leaf may violate + the same rule, so afterwards an additional check is run and the tree + possibly rotated. + + Deleting is hairy. There are mainly two nodes involved: the node to be + deleted (n1), and another node that is to be unchained from the tree (n2). + If n1 has a successor (the node with a smallest key that is larger than + n1), then the successor becomes n2 and its contents are copied into n1, + otherwise n1 becomes n2. + Unchaining a node may violate rule 1: if n2 is black, one subtree is + missing one black edge afterwards. The algorithm must try to move this + error upwards towards the root, so that the subtree that does not have + enough black edges becomes the whole tree. Once that happens, the error + has disappeared. It may not be necessary to go all the way up, since it + is possible that rotations and recoloring can fix the error before that. + + Although the deletion algorithm must walk upwards through the tree, we + do not store parent pointers in the nodes. Instead, delete allocates a + small array of parent pointers and fills it while descending the tree. + Since we know that the length of a path is O(log n), where n is the number + of nodes, this is likely to use less memory. */ + +/* Tree rotations look like this: + A C + / \ / \ + B C A G + / \ / \ --> / \ + D E F G B F + / \ + D E + + In this case, A has been rotated left. This preserves the ordering of the + binary tree. */ #include #include -/* This routine is not very bad. It makes many assumptions about - the compiler. It assumes that the first field in the node must be - the "key" field, which points to the datum. It is very tricky - stuff. H.J. */ - typedef struct node_t { + /* Callers expect this to be the first element in the structure - do not + move! */ const void *key; struct node_t *left; struct node_t *right; + unsigned int red:1; +} *node; + +#undef DEBUGGING + +#ifdef DEBUGGING + +/* Routines to check tree invariants. */ + +#include + +#define CHECK_TREE(a) check_tree(a) + +static void +check_tree_recurse (node p, int d_sofar, int d_total) +{ + if (p == NULL) + { + assert (d_sofar == d_total); + return; + } + + check_tree_recurse (p->left, d_sofar + (p->left && !p->left->red), d_total); + check_tree_recurse (p->right, d_sofar + (p->right && !p->right->red), d_total); + if (p->left) + assert (!(p->left->red && p->red)); + if (p->right) + assert (!(p->right->red && p->red)); +} + +static void +check_tree (node root) +{ + int cnt = 0; + node p; + if (root == NULL) + return; + root->red = 0; + for(p = root->left; p; p = p->left) + cnt += !p->red; + check_tree_recurse (root, 0, cnt); } -node; -/* Prototype fpr local function. */ -static void trecurse __P ((const void *vroot, __action_fn_t action, int level)); +#else -/* find or insert datum into search tree. -char *key; key to be located -node **rootp; address of tree root -int (*compar)(); ordering function -*/ +#define CHECK_TREE(a) + +#endif + +/* Possibly "split" a node with two red successors, and/or fix up two red + edges in a row. ROOTP is a pointer to the lowest node we visited, PARENTP + and GPARENTP pointers to its parent/grandparent. P_R and GP_R contain the + comparison values that determined which way was taken in the tree to reach + ROOTP. MODE is 1 if we need not do the split, but must check for two red + edges between GPARENTP and ROOTP. */ +static void +maybe_split_for_insert (node *rootp, node *parentp, node *gparentp, + int p_r, int gp_r, int mode) +{ + node root = *rootp; + node *rp, *lp; + rp = &(*rootp)->right; + lp = &(*rootp)->left; + + /* See if we have to split this node (both successors red). */ + if (mode == 1 + || ((*rp) != NULL && (*lp) != NULL && (*rp)->red && (*lp)->red)) + { + /* This node becomes red, its successors black. */ + root->red = 1; + if (*rp) + (*rp)->red = 0; + if (*lp) + (*lp)->red = 0; + + /* If the parent of this node is also red, we have to do + rotations. */ + if (parentp != NULL && (*parentp)->red) + { + node gp = *gparentp; + node p = *parentp; + /* There are two main cases: + 1. The edge types (left or right) of the two red edges differ. + 2. Both red edges are of the same type. + There exist two symmetries of each case, so there is a total of + 4 cases. */ + if ((p_r > 0) != (gp_r > 0)) + { + /* Put the child at the top of the tree, with its parent + and grandparent as successors. */ + p->red = 1; + gp->red = 1; + root->red = 0; + if (p_r < 0) + { + /* Child is left of parent. */ + p->left = *rp; + *rp = p; + gp->right = *lp; + *lp = gp; + } + else + { + /* Child is right of parent. */ + p->right = *lp; + *lp = p; + gp->left = *rp; + *rp = gp; + } + *gparentp = root; + } + else + { + *gparentp = *parentp; + /* Parent becomes the top of the tree, grandparent and + child are its successors. */ + p->red = 0; + gp->red = 1; + if (p_r < 0) + { + /* Left edges. */ + gp->left = p->right; + p->right = gp; + } + else + { + /* Right edges. */ + gp->right = p->left; + p->left = gp; + } + } + } + } +} + +/* Find or insert datum into search tree. + KEY is the key to be located, ROOTP is the address of tree root, + COMPAR the ordering function. */ void * -__tsearch (key, vrootp, compar) - const void *key; - void **vrootp; - __compar_fn_t compar; +__tsearch (const void *key, void **vrootp, __compar_fn_t compar) { - node *q; - node **rootp = (node **) vrootp; + node q; + node *parentp = NULL, *gparentp = NULL; + node *rootp = (node *) vrootp; + node *nextp; + int r = 0, p_r = 0, gp_r = 0; /* No they might not, Mr Compiler. */ if (rootp == NULL) return NULL; - while (*rootp != NULL) /* Knuth's T1: */ - { - int r; + /* This saves some additional tests below. */ + if (*rootp != NULL) + (*rootp)->red = 0; + + CHECK_TREE (*rootp); - r = (*compar) (key, (*rootp)->key); - if (r == 0) /* T2: */ - return *rootp; /* we found it! */ - rootp = (r < 0) - ? &(*rootp)->left /* T3: follow left branch */ - : &(*rootp)->right; /* T4: follow right branch */ + nextp = rootp; + while (*nextp != NULL) + { + node root = *rootp; + r = (*compar) (key, root->key); + if (r == 0) + return root; + + maybe_split_for_insert (rootp, parentp, gparentp, p_r, gp_r, 0); + /* If that did any rotations, parentp and gparentp are now garbage. + That doesn't matter, because the values they contain are never + used again in that case. */ + + nextp = r < 0 ? &root->left : &root->right; + if (*nextp == NULL) + break; + + gparentp = parentp; + parentp = rootp; + rootp = nextp; + + gp_r = p_r; + p_r = r; } - q = (node *) malloc (sizeof (node)); /* T5: key not found */ - if (q != NULL) /* make new node */ + q = (struct node_t *) malloc (sizeof (struct node_t)); + if (q != NULL) { - *rootp = q; /* link new node to old */ + *nextp = q; /* link new node to old */ q->key = key; /* initialize new node */ + q->red = 1; q->left = q->right = NULL; } + if (nextp != rootp) + /* There may be two red edges in a row now, which we must avoid by + rotating the tree. */ + maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1); return q; } weak_alias (__tsearch, tsearch) +/* Find datum in search tree. + KEY is the key to be located, ROOTP is the address of tree root, + COMPAR the ordering function. */ void * __tfind (key, vrootp, compar) const void *key; const void **vrootp; __compar_fn_t compar; { - node **rootp = (node **) vrootp; + node *rootp = (node *) vrootp; if (rootp == NULL) return NULL; - while (*rootp != NULL) /* Knuth's T1: */ + CHECK_TREE (*rootp); + + while (*rootp != NULL) { + node root = *rootp; int r; - r = (*compar)(key, (*rootp)->key); - if (r == 0) /* T2: */ - return *rootp; /* we found it! */ + r = (*compar) (key, root->key); + if (r == 0) + return root; - rootp = (r < 0) - ? &(*rootp)->left /* T3: follow left branch */ - : &(*rootp)->right; /* T4: follow right branch */ + rootp = r < 0 ? &root->left : &root->right; } - return NULL; + return NULL; } weak_alias (__tfind, tfind) -/* delete node with given key -char *key; key to be deleted -node **rootp; address of the root of tree -int (*compar)(); comparison function -*/ +/* Delete node with given key. + KEY is the key to be deleted, ROOTP is the address of the root of tree, + COMPAR the comparison function. */ void * -__tdelete (key, vrootp, compar) - const void *key; - void **vrootp; - __compar_fn_t compar; +__tdelete (const void *key, void **vrootp, __compar_fn_t compar) { - node *p; - node *q; - node *r; + node p, q, r, retval; int cmp; - node **rootp = (node **) vrootp; + node *rootp = (node *) vrootp; + node root, unchained; + /* Stack of nodes so we remember the parents without recursion. It's + _very_ unlikely that there are paths longer than 40 nodes. The tree + would need to have around 250.000 nodes. */ + int stacksize = 40; + int sp = 0; + node **nodestack = alloca (sizeof (node *) * stacksize); - if (rootp == NULL || (p = *rootp) == NULL) + if (rootp == NULL) return NULL; + p = *rootp; + if (p == NULL) + return NULL; + + CHECK_TREE (p); while ((cmp = (*compar) (key, (*rootp)->key)) != 0) { + if (sp == stacksize) + { + node **newstack; + stacksize += 20; + newstack = alloca (sizeof (node *) * stacksize); + memcpy (newstack, nodestack, sp * sizeof (node *)); + nodestack = newstack; + } + + nodestack[sp++] = rootp; p = *rootp; - rootp = (cmp < 0) - ? &(*rootp)->left /* follow left branch */ - : &(*rootp)->right; /* follow right branch */ + rootp = ((cmp < 0) + ? &(*rootp)->left + : &(*rootp)->right); if (*rootp == NULL) - return NULL; /* key not found */ + return NULL; } - r = (*rootp)->right; /* D1: */ - q = (*rootp)->left; - if (q == NULL) /* Left NULL? */ - q = r; - else if (r != NULL) /* Right link is NULL? */ + /* This is bogus if the node to be deleted is the root... this routine + really should return an integer with 0 for success, -1 for failure + and errno = ESRCH or something. */ + retval = p; + + /* We don't unchain the node we want to delete. Instead, we overwrite + it with its successor and unchain the successor. If there is no + successor, we really unchain the node to be deleted. */ + + root = *rootp; + + r = root->right; + q = root->left; + + if (q == NULL || r == NULL) + unchained = root; + else { - if (r->left == NULL) /* D2: Find successor */ + node *parent = rootp, *up = &root->right; + for (;;) { - r->left = q; - q = r; + if (sp == stacksize) + { + node **newstack; + stacksize += 20; + newstack = alloca (sizeof (node *) * stacksize); + memcpy (newstack, nodestack, sp * sizeof (node *)); + nodestack = newstack; + } + nodestack[sp++] = parent; + parent = up; + if ((*up)->left == NULL) + break; + up = &(*up)->left; } + unchained = *up; + } + + /* We know that either the left or right successor of UNCHAINED is NULL. + R becomes the other one, it is chained into the parent of UNCHAINED. */ + r = unchained->left; + if (r == NULL) + r = unchained->right; + if (sp == 0) + *rootp = r; + else + { + q = *nodestack[sp-1]; + if (unchained == q->right) + q->right = r; else - { /* D3: Find (struct node_t *)0 link */ - for (q = r->left; q->left != NULL; q = r->left) - r = q; - r->left = q->right; - q->left = (*rootp)->left; - q->right = (*rootp)->right; + q->left = r; + } + + if (unchained != root) + root->key = unchained->key; + if (!unchained->red) + { + /* Now we lost a black edge, which means that the number of black + edges on every path is no longer constant. We must balance the + tree. */ + /* NODESTACK now contains all parents of R. R is likely to be NULL + in the first iteration. */ + /* NULL nodes are considered black throughout - this is necessary for + correctness. */ + while (sp > 0 && (r == NULL || !r->red)) + { + node *pp = nodestack[sp - 1]; + p = *pp; + /* Two symmetric cases. */ + if (r == p->left) + { + /* Q is R's brother, P is R's parent. The subtree with root + R has one black edge less than the subtree with root Q. */ + q = p->right; + if (q != NULL && q->red) + { + /* If Q is red, we know that P is black. We rotate P left + so that Q becomes the top node in the tree, with P below + it. P is colored red, Q is colored black. + This action does not change the black edge count for any + leaf in the tree, but we will be able to recognize one + of the following situations, which all require that Q + is black. */ + q->red = 0; + p->red = 1; + /* Left rotate p. */ + p->right = q->left; + q->left = p; + *pp = q; + /* Make sure pp is right if the case below tries to use + it. */ + nodestack[sp++] = pp = &q->left; + q = p->right; + } + /* We know that Q can't be NULL here. We also know that Q is + black. */ + if ((q->left == NULL || !q->left->red) + && (q->right == NULL || !q->right->red)) + { + /* Q has two black successors. We can simply color Q red. + The whole subtree with root P is now missing one black + edge. Note that this action can temporarily make the + tree invalid (if P is red). But we will exit the loop + in that case and set P black, which both makes the tree + valid and also makes the black edge count come out + right. If P is black, we are at least one step closer + to the root and we'll try again the next iteration. */ + q->red = 1; + r = p; + } + else + { + /* Q is black, one of Q's successors is red. We can + repair the tree with one operation and will exit the + loop afterwards. */ + if (q->right == NULL || !q->right->red) + { + /* The left one is red. We perform the same action as + in maybe_split_for_insert where two red edges are + adjacent but point in different directions: + Q's left successor (let's call it Q2) becomes the + top of the subtree we are looking at, its parent (Q) + and grandparent (P) become its successors. The former + successors of Q2 are placed below P and Q. + P becomes black, and Q2 gets the color that P had. + This changes the black edge count only for node R and + its successors. */ + node q2 = q->left; + q2->red = p->red; + p->right = q2->left; + q->left = q2->right; + q2->right = q; + q2->left = p; + *pp = q2; + p->red = 0; + } + else + { + /* It's the right one. Rotate P left. P becomes black, + and Q gets the color that P had. Q's right successor + also becomes black. This changes the black edge + count only for node R and its successors. */ + q->red = p->red; + p->red = 0; + + q->right->red = 0; + + /* left rotate p */ + p->right = q->left; + q->left = p; + *pp = q; + } + + /* We're done. */ + sp = 1; + r = NULL; + } + } + else + { + /* Comments: see above. */ + q = p->left; + if (q != NULL && q->red) + { + q->red = 0; + p->red = 1; + p->left = q->right; + q->right = p; + *pp = q; + nodestack[sp++] = pp = &q->right; + q = p->left; + } + if ((q->right == NULL || !q->right->red) + && (q->left == NULL || !q->left->red)) + { + q->red = 1; + r = p; + } + else + { + if (q->left == NULL || !q->left->red) + { + node q2 = q->right; + q2->red = p->red; + p->left = q2->right; + q->right = q2->left; + q2->left = q; + q2->right = p; + *pp = q2; + p->red = 0; + } + else + { + q->red = p->red; + p->red = 0; + q->left->red = 0; + p->left = q->right; + q->right = p; + *pp = q; + } + sp = 1; + r = NULL; + } + } + --sp; } + if (r != NULL) + r->red = 0; } - free ((struct node_t *) *rootp); /* D4: Free node */ - *rootp = q; /* link parent to new node */ - return p; + + free (unchained); + return retval; } weak_alias (__tdelete, tdelete) -/* Walk the nodes of a tree -node *root; Root of the tree to be walked -void (*action)(); Function to be called at each node -int level; -*/ +/* Walk the nodes of a tree. + ROOT is the root of the tree to be walked, ACTION the function to be + called at each node. LEVEL is the level of ROOT in the whole tree. */ static void -trecurse (vroot, action, level) - const void *vroot; - __action_fn_t action; - int level; +trecurse (const void *vroot, __action_fn_t action, int level) { - node *root = (node *) vroot; + node root = (node ) vroot; if (root->left == NULL && root->right == NULL) (*action) (root, leaf, level); @@ -201,17 +611,15 @@ trecurse (vroot, action, level) } -/* void twalk(root, action) Walk the nodes of a tree -node *root; Root of the tree to be walked -void (*action)(); Function to be called at each node -PTR -*/ +/* Walk the nodes of a tree. + ROOT is the root of the tree to be walked, ACTION the function to be + called at each node. */ void -__twalk (vroot, action) - const void *vroot; - __action_fn_t action; +__twalk (const void *vroot, __action_fn_t action) { - const node *root = (node *) vroot; + const node root = (node) vroot; + + CHECK_TREE (root); if (root != NULL && action != NULL) trecurse (root, action, 0); diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c new file mode 100644 index 0000000000..eca11cbb95 --- /dev/null +++ b/misc/tst-tsearch.c @@ -0,0 +1,329 @@ +/* Test program for tsearch et al. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define _GNU_SOURCE 1 + +#include +#include +#include + +#define SEED 0 +#define BALANCED 1 +#define PASSES 100 + +#if BALANCED +#include +#define SIZE 1000 +#else +#define SIZE 100 +#endif + +enum order +{ + ascending, + descending, + randomorder +}; + +enum action +{ + build, + build_and_del, + delete, + find +}; + +/* Set to 1 if a test is flunked. */ +static int error = 0; + +/* The keys we add to the tree. */ +static int x[SIZE]; + +/* Pointers into the key array, possibly permutated, to define an order + for insertion/removal. */ +static int y[SIZE]; + +/* Flags set for each element visited during a tree walk. */ +static int z[SIZE]; + +/* Depths for all the elements, to check that the depth is constant for + all three visits. */ +static int depths[SIZE]; + +/* Maximum depth during a tree walk. */ +static int max_depth; + +/* Compare two keys. */ +static int +cmp_fn (const void *a, const void *b) +{ + return *(const int *) a - *(const int *) b; +} + +/* Permute an array of integers. */ +static void +memfry (int *string) +{ + int i; + + for (i = 0; i < SIZE; ++i) + { + int32_t j; + int c; + + j = random () % SIZE; + + c = string[i]; + string[i] = string[j]; + string[j] = c; + } +} + +static void +walk_action (const void *nodep, const VISIT which, const int depth) +{ + int key = **(int **) nodep; + + if (depth > max_depth) + max_depth = depth; + if (which == leaf || which == preorder) + { + ++z[key]; + depths[key] = depth; + } + else + { + if (depths[key] != depth) + { + fputs ("Depth for one element is not constant during tree walk.\n", + stderr); + } + } +} + +static void +walk_tree (void *root, int expected_count) +{ + int i; + + memset (z, 0, sizeof z); + max_depth = 0; + + twalk (root, walk_action); + for (i = 0; i < expected_count; ++i) + if (z[i] != 1) + { + fputs ("Node was not visited.\n", stderr); + error = 1; + } + +#if BALANCED + if (max_depth > log (expected_count) * 2 + 2) +#else + if (max_depth > expected_count) +#endif + { + fputs ("Depth too large during tree walk.\n", stderr); + error = 1; + } +} + +/* Perform an operation on a tree. */ +static void +mangle_tree (enum order how, enum action what, void **root, int lag) +{ + int i; + + if (how == randomorder) + { + for (i = 0; i < SIZE; ++i) + y[i] = i; + memfry (y); + } + + for (i = 0; i < SIZE + lag; ++i) + { + void *elem; + int j, k; + + switch (how) + { + case randomorder: + if (i >= lag) + k = y[i - lag]; + else + k = y[SIZE - i - 1 + lag]; + j = y[i]; + break; + + case ascending: + k = i - lag; + j = i; + break; + + case descending: + k = SIZE - i - 1 + lag; + j = SIZE - i - 1; + break; + + default: + /* This never should happen, but gcc isn't smart enough to + recognize it. */ + abort (); + } + + switch (what) + { + case build_and_del: + case build: + if (i < SIZE) + { + if (tfind (x + j, (const void **) root, cmp_fn) != NULL) + { + fputs ("Found element which is not in tree yet.\n", stderr); + error = 1; + } + elem = tsearch (x + j, root, cmp_fn); + if (elem == 0 + || tfind (x + j, (const void **) root, cmp_fn) == NULL) + { + fputs ("Couldn't find element after it was added.\n", + stderr); + error = 1; + } + } + + if (what == build || i < lag) + break; + + j = k; + /* fall through */ + + case delete: + elem = tfind (x + j, (const void **) root, cmp_fn); + if (elem == NULL || tdelete (x + j, root, cmp_fn) == NULL) + { + fputs ("Error deleting element.\n", stderr); + error = 1; + } + break; + + case find: + if (tfind (x + j, (const void **) root, cmp_fn) == NULL) + { + fputs ("Couldn't find element after it was added.\n", stderr); + error = 1; + } + break; + + } + } +} + + +int +main (int argc, char **argv) +{ + int total_error = 0; + static int state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; + void *root = NULL; + int i, j; + + initstate (SEED, state, 8); + + for (i = 0; i < SIZE; ++i) + x[i] = i; + + /* Do this loop several times to get different permutations for the + random case. */ + fputs ("Series I\n", stderr); + for (i = 0; i < PASSES; ++i) + { + fprintf (stderr, "Pass %d... ", i + 1); + fflush (stdout); + error = 0; + + mangle_tree (ascending, build, &root, 0); + mangle_tree (ascending, find, &root, 0); + mangle_tree (descending, find, &root, 0); + mangle_tree (randomorder, find, &root, 0); + walk_tree (root, SIZE); + mangle_tree (ascending, delete, &root, 0); + + mangle_tree (ascending, build, &root, 0); + walk_tree (root, SIZE); + mangle_tree (descending, delete, &root, 0); + + mangle_tree (ascending, build, &root, 0); + walk_tree (root, SIZE); + mangle_tree (randomorder, delete, &root, 0); + + mangle_tree (descending, build, &root, 0); + mangle_tree (ascending, find, &root, 0); + mangle_tree (descending, find, &root, 0); + mangle_tree (randomorder, find, &root, 0); + walk_tree (root, SIZE); + mangle_tree (descending, delete, &root, 0); + + mangle_tree (descending, build, &root, 0); + walk_tree (root, SIZE); + mangle_tree (descending, delete, &root, 0); + + mangle_tree (descending, build, &root, 0); + walk_tree (root, SIZE); + mangle_tree (randomorder, delete, &root, 0); + + mangle_tree (randomorder, build, &root, 0); + mangle_tree (ascending, find, &root, 0); + mangle_tree (descending, find, &root, 0); + mangle_tree (randomorder, find, &root, 0); + walk_tree (root, SIZE); + mangle_tree (randomorder, delete, &root, 0); + + for (j = 1; j < SIZE; j *= 2) + { + mangle_tree (randomorder, build_and_del, &root, j); + } + + fputs (error ? " failed!\n" : " ok.\n", stderr); + total_error |= error; + } + + fputs ("Series II\n", stderr); + for (i = 1; i < SIZE; i *= 2) + { + fprintf (stderr, "For size %d... ", i); + fflush (stdout); + error = 0; + + mangle_tree (ascending, build_and_del, &root, i); + mangle_tree (descending, build_and_del, &root, i); + mangle_tree (ascending, build_and_del, &root, i); + mangle_tree (descending, build_and_del, &root, i); + mangle_tree (ascending, build_and_del, &root, i); + mangle_tree (descending, build_and_del, &root, i); + mangle_tree (ascending, build_and_del, &root, i); + mangle_tree (descending, build_and_del, &root, i); + + fputs (error ? " failed!\n" : " ok.\n", stderr); + total_error |= error; + } + + return total_error; +} diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 5bcacf296d..f36fe9607d 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -241,13 +241,13 @@ __nss_configure_lookup (const char *dbname, const char *service_line) static int -nss_dlerror_run (void (*operate) (void)) +nss_dlerror_run (void (*operate) (void *), void *args) { char *last_errstring = NULL; const char *last_object_name = NULL; int result; - (void) _dl_catch_error (&last_errstring, &last_object_name, operate); + (void) _dl_catch_error (&last_errstring, &last_object_name, operate, args); result = last_errstring != NULL; if (result) @@ -257,6 +257,42 @@ nss_dlerror_run (void (*operate) (void)) } +struct do_open_args +{ + /* Argument to do_open. */ + char *shlib_name; + service_user *ni; +}; + +struct get_sym_args +{ + /* Arguments to get_sym. */ + struct link_map *map; + char *name; + + /* Return values of get_sym. */ + ElfW(Addr) loadbase; + const ElfW(Sym) *ref; +}; + +static void +do_open (void *a) +{ + struct do_open_args *args = (struct do_open_args *) a; + /* Open and relocate the shared object. */ + args->ni->library->lib_handle = _dl_open (args->shlib_name, RTLD_LAZY); +} + +static void +get_sym (void *a) +{ + struct get_sym_args *args = (struct get_sym_args *) a; + struct link_map *scope[2] = { args->map, NULL }; + args->ref = NULL; + args->loadbase = _dl_lookup_symbol (args->name, &args->ref, + scope, args->map->l_name, 0); +} + /* Comparison function for searching NI->known tree. */ static int known_compare (const void *p1, const void *p2) @@ -332,21 +368,19 @@ nss_lookup_function (service_user *ni, const char *fct_name) /* Load the shared library. */ size_t shlen = (7 + strlen (ni->library->name) + 3 + strlen (__nss_shlib_revision) + 1); - char shlib_name[shlen]; - void do_open (void) - { - /* Open and relocate the shared object. */ - ni->library->lib_handle = _dl_open (shlib_name, RTLD_LAZY); - } + struct do_open_args args; + args.shlib_name = __alloca (shlen); + args.ni = ni; /* Construct shared object name. */ - __stpcpy (__stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"), + __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.shlib_name, + "libnss_"), ni->library->name), ".so"), __nss_shlib_revision); - if (nss_dlerror_run (do_open) != 0) + if (nss_dlerror_run (do_open, &args) != 0) /* Failed to load the library. */ ni->library->lib_handle = (void *) -1l; } @@ -359,26 +393,19 @@ nss_lookup_function (service_user *ni, const char *fct_name) /* Get the desired function. Again, GNU ld.so magic ahead. */ size_t namlen = (5 + strlen (ni->library->name) + 1 + strlen (fct_name) + 1); - char name[namlen]; - struct link_map *map = ni->library->lib_handle; - ElfW(Addr) loadbase; - const ElfW(Sym) *ref = NULL; - void get_sym (void) - { - struct link_map *scope[2] = { map, NULL }; - loadbase = _dl_lookup_symbol (name, &ref, - scope, map->l_name, 0); - } + struct get_sym_args args; + args.name = __alloca (namlen); + args.map = ni->library->lib_handle; /* Construct the function name. */ - __stpcpy (__stpcpy (__stpcpy (__stpcpy (name, "_nss_"), + __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.name, "_nss_"), ni->library->name), "_"), fct_name); /* Look up the symbol. */ - result = (nss_dlerror_run (get_sym) - ? NULL : (void *) (loadbase + ref->st_value)); + result = (nss_dlerror_run (get_sym, &args) ? NULL + : (void *) (args.loadbase + args.ref->st_value)); } /* Remember function pointer for later calls. Even if null, we diff --git a/po/libc.pot b/po/libc.pot index dfaea8a48b..4ad9360e52 100644 --- a/po/libc.pot +++ b/po/libc.pot @@ -5,8 +5,8 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: libc 2.0.1\n" -"POT-Creation-Date: 1997-02-04 16:58+0100\n" +"Project-Id-Version: libc 2.0.90\n" +"POT-Creation-Date: 1997-03-27 03:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+DIST\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,51 +14,128 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: sunrpc/rpcinfo.c:612 +#: nis/nis_print.c:210 +msgid "\t\tAccess Rights : " +msgstr "" + +#: nis/nis_print.c:208 +#, c-format +msgid "\t\tAttributes : %s\n" +msgstr "" + +#: nis/nis_print.c:229 +#, c-format +msgid "\tEntry data of type %s\n" +msgstr "" + +#: nis/nis_print.c:115 +#, c-format +msgid "\tName : %s\n" +msgstr "" + +#: nis/nis_print.c:116 +msgid "\tPublic Key : " +msgstr "" + +#: nis/nis_print.c:142 +#, c-format +msgid "\tUniversal addresses (%u)\n" +msgstr "" + +#: nis/nis_print.c:206 +#, c-format +msgid "\t[%d]\tName : %s\n" +msgstr "" + +#: nis/nis_print.c:232 +#, c-format +msgid "\t[%u] - [%u bytes] " +msgstr "" + +#: nis/nis_print.c:174 +#, c-format +msgid "" +"\n" +"Direct Type : %d\n" +msgstr "" + +#: nis/nis_print.c:188 +msgid "" +"\n" +"Group Members :\n" +msgstr "" + +#: nis/nis_print.c:252 +#, c-format +msgid "" +"\n" +"Time to Live : %lu (seconds)\n" +msgstr "" + +#: sunrpc/rpcinfo.c:680 msgid " rpcinfo -b prognum versnum\n" msgstr "" -#: sunrpc/rpcinfo.c:613 +#: sunrpc/rpcinfo.c:681 msgid " rpcinfo -d prognum versnum\n" msgstr "" -#: sunrpc/rpcinfo.c:611 +#: sunrpc/rpcinfo.c:679 msgid " rpcinfo -p [ host ]\n" msgstr "" -#: sunrpc/rpcinfo.c:610 +#: sunrpc/rpcinfo.c:678 msgid " rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n" msgstr "" -#: sunrpc/rpcinfo.c:517 +#: nis/nis_print.c:286 +#, c-format +msgid " Data Length = %u\n" +msgstr "" + +#: sunrpc/rpcinfo.c:577 msgid " program vers proto port\n" msgstr "" -#: time/zic.c:425 +#: time/zic.c:419 #, c-format msgid " (rule from \"%s\", line %d)" msgstr "" -#: locale/programs/ld-collate.c:360 locale/programs/ld-ctype.c:1235 +#: argp/argp-help.c:1511 +msgid " [OPTION...]" +msgstr "" + +#: locale/programs/ld-collate.c:363 locale/programs/ld-ctype.c:1242 msgid " done\n" msgstr "" -#: time/zic.c:422 +#: time/zic.c:416 #, c-format msgid "\"%s\", line %d: %s" msgstr "" -#: time/zic.c:949 +#: time/zic.c:943 #, c-format msgid "\"Zone %s\" line and -l option are mutually exclusive" msgstr "" -#: time/zic.c:957 +#: time/zic.c:951 #, c-format msgid "\"Zone %s\" line and -p option are mutually exclusive" msgstr "" -#: time/zic.c:760 +#: argp/argp-help.c:183 +#, c-format +msgid "%.*s: ARGP_HELP_FMT parameter requires a value" +msgstr "" + +#: argp/argp-help.c:191 +#, c-format +msgid "%.*s: Unknown ARGP_HELP_FMT parameter" +msgstr "" + +#: time/zic.c:754 #, c-format msgid "%s in ruleless zone" msgstr "" @@ -78,7 +155,7 @@ msgstr "" msgid "%s%sUnknown signal %d\n" msgstr "" -#: time/zic.c:2155 +#: time/zic.c:2172 #, c-format msgid "%s: %d did not sign extend correctly\n" msgstr "" @@ -88,142 +165,147 @@ msgstr "" msgid "%s: must be greater than \n" msgstr "" -#: time/zic.c:1445 +#: time/zic.c:1443 #, c-format msgid "%s: Can't create %s: %s\n" msgstr "" -#: time/zic.c:2134 +#: time/zic.c:2150 #, c-format msgid "%s: Can't create directory %s: %s\n" msgstr "" -#: time/zic.c:614 +#: time/zic.c:608 #, c-format msgid "%s: Can't link from %s to %s: %s\n" msgstr "" -#: time/zic.c:786 +#: time/zic.c:780 #, c-format msgid "%s: Can't open %s: %s\n" msgstr "" -#: time/zic.c:1435 +#: time/zic.c:1433 #, c-format msgid "%s: Can't remove %s: %s\n" msgstr "" -#: time/zic.c:855 +#: time/zic.c:849 #, c-format msgid "%s: Error closing %s: %s\n" msgstr "" -#: time/zic.c:848 +#: time/zic.c:842 #, c-format msgid "%s: Error reading %s\n" msgstr "" -#: time/zic.c:1509 +#: time/zic.c:1507 #, c-format msgid "%s: Error writing %s\n" msgstr "" -#: time/zdump.c:258 +#: time/zdump.c:266 #, c-format msgid "%s: Error writing standard output " msgstr "" -#: time/zic.c:833 +#: time/zic.c:827 #, c-format msgid "%s: Leap line in non leap seconds file %s\n" msgstr "" -#: time/zic.c:363 +#: time/zic.c:357 #, c-format msgid "%s: Memory exhausted: %s\n" msgstr "" -#: time/zic.c:528 +#: time/zic.c:522 #, c-format msgid "%s: More than one -L option specified\n" msgstr "" -#: time/zic.c:488 +#: time/zic.c:482 #, c-format msgid "%s: More than one -d option specified\n" msgstr "" -#: time/zic.c:498 +#: time/zic.c:492 #, c-format msgid "%s: More than one -l option specified\n" msgstr "" -#: time/zic.c:508 +#: time/zic.c:502 #, c-format msgid "%s: More than one -p option specified\n" msgstr "" -#: time/zic.c:518 +#: time/zic.c:512 #, c-format msgid "%s: More than one -y option specified\n" msgstr "" -#: time/zic.c:1860 +#: argp/argp-parse.c:628 +#, c-format +msgid "%s: Too many arguments\n" +msgstr "" + +#: time/zic.c:1872 #, c-format msgid "%s: command was '%s', result was %d\n" msgstr "" -#: locale/programs/charmap.c:593 locale/programs/locfile.c:878 +#: locale/programs/charmap.c:593 locale/programs/locfile.c:900 #, c-format msgid "%s: error in state machine" msgstr "" -#: posix/getopt.c:788 +#: posix/getopt.c:785 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" -#: posix/getopt.c:791 +#: posix/getopt.c:788 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" -#: posix/getopt.c:712 +#: posix/getopt.c:709 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:683 +#: posix/getopt.c:680 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" -#: posix/getopt.c:729 posix/getopt.c:902 +#: posix/getopt.c:726 posix/getopt.c:899 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" -#: posix/getopt.c:707 +#: posix/getopt.c:704 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:886 +#: posix/getopt.c:883 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:868 +#: posix/getopt.c:865 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" -#: posix/getopt.c:821 posix/getopt.c:951 +#: posix/getopt.c:818 posix/getopt.c:948 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" -#: time/zic.c:840 time/zic.c:1252 time/zic.c:1272 +#: time/zic.c:834 time/zic.c:1246 time/zic.c:1266 #, c-format msgid "%s: panic: Invalid l_value %d\n" msgstr "" @@ -233,17 +315,17 @@ msgstr "" msgid "%s: premature end of file" msgstr "" -#: posix/getopt.c:762 +#: posix/getopt.c:759 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" -#: posix/getopt.c:758 +#: posix/getopt.c:755 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" -#: time/zic.c:447 +#: time/zic.c:441 #, c-format msgid "" "%s: usage is %s [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d " @@ -251,59 +333,69 @@ msgid "" "\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n" msgstr "" -#: time/zdump.c:165 +#: time/zdump.c:174 #, c-format msgid "%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n" msgstr "" -#: sunrpc/clnt_perr.c:125 +#: nis/nis_print.c:290 +msgid "(Unknown object)\n" +msgstr "" + +#: sunrpc/clnt_perr.c:119 #, c-format msgid "(unknown authentication error - %d)" msgstr "" -#: sunrpc/rpcinfo.c:555 +#: sunrpc/rpcinfo.c:616 msgid "(unknown)" msgstr "" -#: catgets/gencat.c:254 +#: catgets/gencat.c:265 msgid "*standard input*" msgstr "" +#: catgets/gencat.c:120 +msgid "" +"-o OUTPUT-FILE [INPUT-FILE]...\n" +"[OUTPUT-FILE [INPUT-FILE]...]" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:766 msgid ".lib section in a.out corrupted" msgstr "" -#: inet/rcmd.c:359 +#: inet/rcmd.c:363 msgid ".rhosts fstat failed" msgstr "" -#: inet/rcmd.c:355 +#: inet/rcmd.c:359 msgid ".rhosts lstat failed" msgstr "" -#: inet/rcmd.c:357 +#: inet/rcmd.c:361 msgid ".rhosts not regular file" msgstr "" -#: inet/rcmd.c:363 +#: inet/rcmd.c:367 msgid ".rhosts writeable by other than owner" msgstr "" -#: sunrpc/clnt_perr.c:112 sunrpc/clnt_perr.c:133 +#: sunrpc/clnt_perr.c:105 sunrpc/clnt_perr.c:126 #, c-format msgid "; low version = %lu, high version = %lu" msgstr "" -#: sunrpc/clnt_perr.c:119 +#: sunrpc/clnt_perr.c:112 msgid "; why = " msgstr "" -#: locale/programs/ld-ctype.c:326 +#: locale/programs/ld-ctype.c:331 #, c-format msgid " character must not be in class `%s'" msgstr "" -#: locale/programs/ld-ctype.c:317 +#: locale/programs/ld-ctype.c:321 #, c-format msgid " character not in class `%s'" msgstr "" @@ -319,6 +411,10 @@ msgstr "" msgid "Aborted" msgstr "" +#: nis/nis_print.c:250 +msgid "Access Rights : " +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:762 msgid "Accessing a corrupted shared library" msgstr "" @@ -328,6 +424,10 @@ msgstr "" msgid "Address already in use" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:30 +msgid "Address family for hostname not supported" +msgstr "" + #. TRANS The address family specified for a socket is not supported; it is #. TRANS inconsistent with the protocol being used on the socket. @xref{Sockets}. #: stdio-common/../sysdeps/gnu/errlist.c:349 @@ -351,11 +451,20 @@ msgstr "" msgid "Argument list too long" msgstr "" +#: nis/nis_error.c:65 +msgid "Attempt to remove a non-empty table" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:770 msgid "Attempting to link in too many shared libraries" msgstr "" -#: sunrpc/clnt_perr.c:276 +#: nis/nis_print.c:221 +#, c-format +msgid "Attributes : %d\n" +msgstr "" + +#: sunrpc/clnt_perr.c:273 msgid "Authentication OK" msgstr "" @@ -364,6 +473,10 @@ msgstr "" msgid "Authentication error" msgstr "" +#: nis/nis_print.c:259 +msgid "BOGUS OBJECT\n" +msgstr "" + #. TRANS Bad address; an invalid pointer was detected. #. TRANS In the GNU system, this error never happens; you get a signal instead. #: stdio-common/../sysdeps/gnu/errlist.c:102 @@ -390,6 +503,18 @@ msgstr "" msgid "Bad system call" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:32 +msgid "Bad value for ai_flags" +msgstr "" + +#: locale/programs/localedef.c:109 +msgid "Be strictly POSIX conform" +msgstr "" + +#: nis/nis_print.c:237 +msgid "Binary data\n" +msgstr "" + #. TRANS A file that isn't a block special file was given in a situation that #. TRANS requires one. For example, trying to mount an ordinary file as a file #. TRANS system in Unix gives this error. @@ -397,7 +522,7 @@ msgstr "" msgid "Block device required" msgstr "" -#: sunrpc/pmap_rmt.c:337 +#: sunrpc/pmap_rmt.c:356 msgid "Broadcast select problem" msgstr "" @@ -417,27 +542,35 @@ msgstr "" msgid "Bus error" msgstr "" +#: nis/nis_print.c:44 +msgid "CDS" +msgstr "" + #: sysdeps/unix/sysv/linux/siglist.h:43 msgid "CPU time limit exceeded" msgstr "" +#: nis/nis_error.c:32 +msgid "Cache expired" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:758 msgid "Can not access a needed shared library" msgstr "" -#: nis/ypclnt.c:694 +#: nis/ypclnt.c:697 msgid "Can't bind to server which serves this domain" msgstr "" -#: nis/ypclnt.c:706 +#: nis/ypclnt.c:709 msgid "Can't communicate with portmapper" msgstr "" -#: nis/ypclnt.c:708 +#: nis/ypclnt.c:711 msgid "Can't communicate with ypbind" msgstr "" -#: nis/ypclnt.c:710 +#: nis/ypclnt.c:713 msgid "Can't communicate with ypserv" msgstr "" @@ -454,7 +587,7 @@ msgstr "" msgid "Cannot assign requested address" msgstr "" -#: sunrpc/pmap_rmt.c:255 +#: sunrpc/pmap_rmt.c:266 msgid "Cannot create socket for broadcast rpc" msgstr "" @@ -462,11 +595,11 @@ msgstr "" msgid "Cannot exec a shared library directly" msgstr "" -#: sunrpc/pmap_rmt.c:349 +#: sunrpc/pmap_rmt.c:369 msgid "Cannot receive reply to broadcast" msgstr "" -#: sunrpc/pmap_clnt.c:79 +#: sunrpc/pmap_clnt.c:76 msgid "Cannot register service" msgstr "" @@ -475,11 +608,11 @@ msgstr "" msgid "Cannot send after transport endpoint shutdown" msgstr "" -#: sunrpc/pmap_rmt.c:313 +#: sunrpc/pmap_rmt.c:329 msgid "Cannot send broadcast packet" msgstr "" -#: sunrpc/pmap_rmt.c:261 +#: sunrpc/pmap_rmt.c:273 msgid "Cannot set socket option SO_BROADCAST" msgstr "" @@ -487,29 +620,42 @@ msgstr "" msgid "Channel number out of range" msgstr "" +#: nis/nis_print.c:201 +#, c-format +msgid "Character Separator : %c\n" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:49 #: sysdeps/unix/sysv/linux/siglist.h:39 msgid "Child exited" msgstr "" -#: sunrpc/clnt_perr.c:286 +#: sunrpc/clnt_perr.c:283 msgid "Client credential too weak" msgstr "" +#: nis/nis_print.c:203 +msgid "Columns :\n" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:738 msgid "Communication error on send" msgstr "" +#: locale/programs/localedef.c:117 +msgid "Compile locale specification" +msgstr "" + #. TRANS Go home and have a glass of warm, dairy-fresh milk. #: stdio-common/../sysdeps/gnu/errlist.c:601 msgid "Computer bought the farm" msgstr "" -#: locale/programs/ld-ctype.c:1198 +#: locale/programs/ld-ctype.c:1204 msgid "Computing table size for character classes might take a while..." msgstr "" -#: locale/programs/ld-collate.c:327 +#: locale/programs/ld-collate.c:329 msgid "Computing table size for collation information might take a while..." msgstr "" @@ -537,8 +683,12 @@ msgstr "" msgid "Continued" msgstr "" -#: catgets/gencat.c:169 db/makedb.c:120 locale/programs/locale.c:187 -#: locale/programs/localedef.c:177 +#: db/makedb.c:57 +msgid "Convert key to lower case" +msgstr "" + +#: catgets/gencat.c:235 db/makedb.c:230 locale/programs/locale.c:267 +#: locale/programs/localedef.c:392 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" @@ -550,10 +700,51 @@ msgstr "" msgid "Cputime limit exceeded" msgstr "" -#: nis/ypclnt.c:720 +#: catgets/gencat.c:107 +msgid "Create C header file NAME containing symbol definitions" +msgstr "" + +#: locale/programs/localedef.c:108 +msgid "Create output even if warning messages were issued" +msgstr "" + +#: db/makedb.c:67 +msgid "Create simple DB database from textual input." +msgstr "" + +#: nis/nis_print.c:253 +#, c-format +msgid "Creation Time : %s" +msgstr "" + +#: nis/nis_print.c:123 +msgid "DH.\n" +msgstr "" + +#: nis/nis_print.c:265 +msgid "DIRECTORY\n" +msgstr "" + +#: nis/nis_print.c:40 +msgid "DNANS" +msgstr "" + +#: nis/nis_print.c:36 +msgid "DNS" +msgstr "" + +#: nis/nis_error.c:51 +msgid "Database for table does not exist" +msgstr "" + +#: nis/ypclnt.c:723 msgid "Database is busy" msgstr "" +#: nis/nis_print.c:172 +msgid "Default Access rights: " +msgstr "" + #. TRANS No default destination address was set for the socket. You get this #. TRANS error when you try to transmit data over a connectionless socket, #. TRANS without first specifying a destination for the data with @code{connect}. @@ -581,6 +772,11 @@ msgstr "" msgid "Device or resource busy" msgstr "" +#: nis/nis_print.c:247 +#, c-format +msgid "Directory : %s\n" +msgstr "" + #. TRANS Directory not empty, where an empty directory was expected. Typically, #. TRANS this error occurs when you are trying to delete a directory. #: stdio-common/../sysdeps/gnu/errlist.c:468 @@ -592,7 +788,15 @@ msgstr "" msgid "Disc quota exceeded" msgstr "" -#: nis/ypclnt.c:766 +#: db/makedb.c:60 +msgid "Do not print messages while building database" +msgstr "" + +#: catgets/gencat.c:109 +msgid "Do not use existing catalog, force new output file" +msgstr "" + +#: nis/ypclnt.c:769 msgid "Domain not bound" msgstr "" @@ -601,19 +805,47 @@ msgstr "" msgid "EMT trap" msgstr "" -#: sunrpc/clnt_perr.c:254 +#: nis/nis_print.c:277 +msgid "ENTRY\n" +msgstr "" + +#: nis/nis_print.c:235 +msgid "Encrypted data\n" +msgstr "" + +#: nis/nis_error.c:52 +msgid "Entry/Table type mismatch" +msgstr "" + +#: sunrpc/clnt_perr.c:247 #, c-format msgid "Error %d" msgstr "" +#: nis/nis_error.c:56 +msgid "Error in RPC subsystem" +msgstr "" + +#: nis/nis_error.c:66 +msgid "Error in accessing NIS+ cold start file. Is NIS+ installed?" +msgstr "" + #: string/../sysdeps/mach/_strerror.c:52 msgid "Error in unknown error system: " msgstr "" +#: nis/nis_error.c:59 +msgid "Error while talking to callback proc" +msgstr "" + #: inet/ruserpass.c:161 msgid "Error: .netrc file is readable by others." msgstr "" +#: nis/nis_call.c:180 +msgid "Error: could not find a NIS_COLD_START file\n" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:698 msgid "Exchange full" msgstr "" @@ -624,11 +856,11 @@ msgstr "" msgid "Exec format error" msgstr "" -#: locale/programs/localedef.c:213 +#: locale/programs/localedef.c:195 msgid "FATAL: system does not define `_POSIX2_LOCALEDEF'" msgstr "" -#: sunrpc/clnt_perr.c:290 +#: sunrpc/clnt_perr.c:287 msgid "Failed (unspecified error)" msgstr "" @@ -666,11 +898,19 @@ msgstr "" msgid "Filesize limit exceeded" msgstr "" +#: nis/nis_error.c:37 +msgid "First/Next chain broken" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:37 #: sysdeps/unix/sysv/linux/siglist.h:28 msgid "Floating point exception" msgstr "" +#: nis/nis_error.c:67 +msgid "Full resync required for directory" +msgstr "" + #. TRANS Function not implemented. Some functions have commands or options defined #. TRANS that might not be supported in all implementations, and this is the kind #. TRANS of error you get if you request them and they are not supported. @@ -678,11 +918,44 @@ msgstr "" msgid "Function not implemented" msgstr "" +#: nis/nis_print.c:269 +msgid "GROUP\n" +msgstr "" + +#: argp/argp-help.c:201 +#, c-format +msgid "Garbage in ARGP_HELP_FMT: %s" +msgstr "" + +#: catgets/gencat.c:115 +msgid "" +"Generate message catalog.\\vIf INPUT-FILE is -, input is read from standard " +"input. If OUTPUT-FILE\n" +"is -, output is written to standard output.\n" +msgstr "" + +#: nis/nis_error.c:36 +msgid "Generic system error" +msgstr "" + +#: locale/programs/locale.c:75 +msgid "Get locale-specific information." +msgstr "" + #. TRANS This error code has no purpose. #: stdio-common/../sysdeps/gnu/errlist.c:606 msgid "Gratuitous error" msgstr "" +#: nis/nis_print.c:249 +#, c-format +msgid "Group : %s\n" +msgstr "" + +#: nis/nis_print.c:185 +msgid "Group Flags :" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:30 #: sysdeps/unix/sysv/linux/siglist.h:22 msgid "Hangup" @@ -702,10 +975,21 @@ msgstr "" msgid "I/O possible" msgstr "" +#: db/makedb.c:70 +msgid "" +"INPUT-FILE OUTPUT-FILE\n" +"-o OUTPUT-FILE INPUT-FILE\n" +"-u INPUT-FILE" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:35 msgid "IOT trap" msgstr "" +#: nis/nis_print.c:34 +msgid "IVY" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:614 msgid "Identifier removed" msgstr "" @@ -718,6 +1002,10 @@ msgstr "" msgid "Illegal instruction" msgstr "" +#: nis/nis_error.c:61 +msgid "Illegal object type for operation" +msgstr "" + #. TRANS Invalid seek operation (such as on a pipe). #: stdio-common/../sysdeps/gnu/errlist.c:201 msgid "Illegal seek" @@ -752,16 +1040,20 @@ msgstr "" msgid "Information request" msgstr "" +#: locale/programs/localedef.c:99 +msgid "Input Files:" +msgstr "" + #. TRANS Input/output error; usually used for physical read or write errors. #: stdio-common/../sysdeps/gnu/errlist.c:40 msgid "Input/output error" msgstr "" -#: nis/ypclnt.c:700 +#: nis/ypclnt.c:703 msgid "Internal NIS error" msgstr "" -#: nis/ypclnt.c:764 +#: nis/ypclnt.c:767 msgid "Internal ypbind error" msgstr "" @@ -785,33 +1077,37 @@ msgstr "" msgid "Interrupted system call should be restarted" msgstr "" +#: nis/nis_error.c:44 +msgid "Invalid Object for operation" +msgstr "" + #. TRANS Invalid argument. This is used to indicate various kinds of problems #. TRANS with passing the wrong argument to a library function. #: stdio-common/../sysdeps/gnu/errlist.c:152 msgid "Invalid argument" msgstr "" -#: posix/regex.c:946 +#: posix/regex.c:960 msgid "Invalid back reference" msgstr "" -#: posix/regex.c:944 +#: posix/regex.c:958 msgid "Invalid character class name" msgstr "" -#: sunrpc/clnt_perr.c:278 +#: sunrpc/clnt_perr.c:275 msgid "Invalid client credential" msgstr "" -#: sunrpc/clnt_perr.c:282 +#: sunrpc/clnt_perr.c:279 msgid "Invalid client verifier" msgstr "" -#: posix/regex.c:943 +#: posix/regex.c:957 msgid "Invalid collation character" msgstr "" -#: posix/regex.c:950 +#: posix/regex.c:964 msgid "Invalid content of \\{\\}" msgstr "" @@ -832,15 +1128,15 @@ msgstr "" msgid "Invalid or incomplete multibyte or wide character" msgstr "" -#: posix/regex.c:953 +#: posix/regex.c:967 msgid "Invalid preceding regular expression" msgstr "" -#: posix/regex.c:951 +#: posix/regex.c:965 msgid "Invalid range end" msgstr "" -#: posix/regex.c:942 +#: posix/regex.c:956 msgid "Invalid regular expression" msgstr "" @@ -852,7 +1148,7 @@ msgstr "" msgid "Invalid request descriptor" msgstr "" -#: sunrpc/clnt_perr.c:288 +#: sunrpc/clnt_perr.c:285 msgid "Invalid server verifier" msgstr "" @@ -870,11 +1166,24 @@ msgstr "" msgid "Is a named type file" msgstr "" +#: nis/nis_print.c:129 +msgid "Kerberous.\n" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:38 #: sysdeps/unix/sysv/linux/siglist.h:29 msgid "Killed" msgstr "" +#: nis/nis_print.c:281 +msgid "LINK\n" +msgstr "" + +#: nis/nis_local_names.c:125 +#, c-format +msgid "LOCAL entry for UID %d in directory %s not unique\n" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:686 msgid "Level 2 halted" msgstr "" @@ -891,6 +1200,10 @@ msgstr "" msgid "Level 3 reset" msgstr "" +#: nis/nis_error.c:53 +msgid "Link Points to illegal name" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:626 msgid "Link has been severed" msgstr "" @@ -899,11 +1212,11 @@ msgstr "" msgid "Link number out of range" msgstr "" -#: nis/ypclnt.c:712 +#: nis/ypclnt.c:715 msgid "Local domain name not set" msgstr "" -#: nis/ypclnt.c:702 +#: nis/ypclnt.c:705 msgid "Local resource allocation failure" msgstr "" @@ -911,7 +1224,29 @@ msgstr "" msgid "Machine is not on the network" msgstr "" -#: posix/regex.c:952 +#: nis/nis_error.c:45 +msgid "Malformed Name, or illegal name" +msgstr "" + +#: argp/argp-help.c:1132 +msgid "" +"Mandatory or optional arguments to long options are also mandatory or " +"optional for any corresponding short options." +msgstr "" + +#: nis/nis_print.c:112 +msgid "Master Server :\n" +msgstr "" + +#: nis/nis_error.c:75 +msgid "Master server busy, full dump rescheduled." +msgstr "" + +#: posix/../sysdeps/posix/gai_strerror.c:35 +msgid "Memory allocation failure" +msgstr "" + +#: posix/regex.c:966 msgid "Memory exhausted" msgstr "" @@ -921,22 +1256,100 @@ msgstr "" msgid "Message too long" msgstr "" +#: nis/nis_error.c:57 +msgid "Missing or malformed attribute" +msgstr "" + +#: nis/nis_print.c:254 +#, c-format +msgid "Mod. Time : %s" +msgstr "" + +#: nis/nis_error.c:50 +msgid "Modification failed" +msgstr "" + +#: nis/nis_error.c:63 +msgid "Modify operation failed" +msgstr "" + +#: locale/programs/locale.c:68 +msgid "Modify output format:" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:618 msgid "Multihop attempted" msgstr "" -#: nis/ypclnt.c:716 +#: catgets/gencat.c:106 catgets/gencat.c:110 db/makedb.c:58 +#: locale/programs/localedef.c:120 +msgid "NAME" +msgstr "" + +#: locale/programs/locale.c:78 +msgid "" +"NAME\n" +"[-a|-m]" +msgstr "" + +#: nis/nis_print.c:30 +msgid "NIS" +msgstr "" + +#: nis/ypclnt.c:719 msgid "NIS client/server version mismatch - can't supply service" msgstr "" -#: nis/ypclnt.c:714 +#: nis/ypclnt.c:717 msgid "NIS map data base is bad" msgstr "" +#: nis/nis_error.c:68 +msgid "NIS+ operation failed" +msgstr "" + +#: nis/nis_error.c:33 +msgid "NIS+ servers unreachable" +msgstr "" + +#: nis/nis_error.c:69 +msgid "NIS+ service is unavailable or not installed" +msgstr "" + +#: nis/nis_print.c:262 +msgid "NO OBJECT\n" +msgstr "" + +#: nis/nis_print.c:220 +#, c-format +msgid "Name : %s\n" +msgstr "" + +#: nis/nis_print.c:106 +#, c-format +msgid "Name : '%s'\n" +msgstr "" + +#: nis/nis_error.c:40 +msgid "Name not served by this server" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:746 msgid "Name not unique on network" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:37 +msgid "Name or service not known" +msgstr "" + +#: nis/nis_error.c:49 +msgid "Name/entry isn't unique" +msgstr "" + +#: nis/nis_error.c:58 +msgid "Named object is not searchable" +msgstr "" + #. TRANS ??? #: stdio-common/../sysdeps/gnu/errlist.c:554 msgid "Need authenticator" @@ -966,6 +1379,10 @@ msgstr "" msgid "No XENIX semaphores available" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:36 +msgid "No address associated with hostname" +msgstr "" + #: resolv/herror.c:77 msgid "No address associated with name" msgstr "" @@ -992,6 +1409,10 @@ msgstr "" msgid "No data available" msgstr "" +#: nis/nis_error.c:73 +msgid "No file space on server" +msgstr "" + #. TRANS No locks available. This is used by the file locking facilities; see #. TRANS @ref{File Locks}. This error is never generated by the GNU system, but #. TRANS it can result from an operation to an NFS server running another @@ -1000,7 +1421,7 @@ msgstr "" msgid "No locks available" msgstr "" -#: posix/regex.c:941 +#: posix/regex.c:955 msgid "No match" msgstr "" @@ -1008,15 +1429,15 @@ msgstr "" msgid "No message of desired type" msgstr "" -#: nis/ypclnt.c:704 +#: nis/ypclnt.c:707 msgid "No more records in map database" msgstr "" -#: posix/regex.c:5204 +#: posix/regex.c:5324 msgid "No previous regular expression" msgstr "" -#: sunrpc/rpcinfo.c:515 +#: sunrpc/rpcinfo.c:573 msgid "No remote programs registered.\n" msgstr "" @@ -1038,11 +1459,11 @@ msgstr "" msgid "No such file or directory" msgstr "" -#: nis/ypclnt.c:698 +#: nis/ypclnt.c:701 msgid "No such key in map" msgstr "" -#: nis/ypclnt.c:696 +#: nis/ypclnt.c:699 msgid "No such map in server's domain" msgstr "" @@ -1051,6 +1472,26 @@ msgstr "" msgid "No such process" msgstr "" +#: argp/argp-parse.c:163 +msgid "No version known!?" +msgstr "" + +#: nis/nis_error.c:60 +msgid "Non NIS+ namespace encountered" +msgstr "" + +#: posix/../sysdeps/posix/gai_strerror.c:33 +msgid "Non-recoverable failure in name resolution" +msgstr "" + +#: nis/nis_print.c:120 +msgid "None.\n" +msgstr "" + +#: nis/nis_error.c:48 +msgid "Not Found, no such name" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:786 msgid "Not a XENIX named type file" msgstr "" @@ -1060,6 +1501,28 @@ msgstr "" msgid "Not a directory" msgstr "" +#: nis/nis_error.c:30 +msgid "Not found" +msgstr "" + +#: nis/nis_error.c:43 +msgid "Not master server for this domain" +msgstr "" + +#: nis/nis_error.c:39 +msgid "Not owner" +msgstr "" + +#: nis/nis_print.c:200 +#, c-format +msgid "Number of Columns : %d\n" +msgstr "" + +#: nis/nis_print.c:301 +#, c-format +msgid "Number of objects : %u\n" +msgstr "" + #. TRANS Domain error; used by mathematical functions when an argument value does #. TRANS not fall into the domain over which the function is defined. #: stdio-common/../sysdeps/gnu/errlist.c:228 @@ -1072,6 +1535,20 @@ msgstr "" msgid "Numerical result out of range" msgstr "" +#: nis/nis_print.c:305 +#, c-format +msgid "Object #%d:\n" +msgstr "" + +#: nis/nis_print.c:246 +#, c-format +msgid "Object Name : %s\n" +msgstr "" + +#: nis/nis_print.c:255 +msgid "Object Type : " +msgstr "" + #. TRANS An attempt was made to NFS-mount a remote file system with a file name that #. TRANS already specifies an NFS-mounted file. #. TRANS (This is an error on some operating systems, but we expect it to work @@ -1080,7 +1557,11 @@ msgstr "" msgid "Object is remote" msgstr "" -#: time/zic.c:1954 +#: nis/nis_error.c:42 +msgid "Object with same name exists" +msgstr "" + +#: time/zic.c:1966 msgid "Odd number of quotation marks" msgstr "" @@ -1137,12 +1618,34 @@ msgstr "" msgid "Out of streams resources" msgstr "" +#: locale/programs/localedef.c:106 +msgid "Output control:" +msgstr "" + +#: nis/nis_print.c:248 +#, c-format +msgid "Owner : %s\n" +msgstr "" + +#: nis/nis_print.c:285 +msgid "PRIVATE\n" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:726 msgid "Package not installed" msgstr "" +#: nis/nis_error.c:54 +msgid "Partial Success" +msgstr "" + +#: nis/nis_error.c:62 +msgid "Passed object is not the same object on server" +msgstr "" + #. TRANS Permission denied; the file permissions do not allow the attempted operation. -#: nis/ypclnt.c:718 stdio-common/../sysdeps/gnu/errlist.c:96 +#: nis/nis_error.c:38 nis/ypclnt.c:721 +#: stdio-common/../sysdeps/gnu/errlist.c:96 msgid "Permission denied" msgstr "" @@ -1150,10 +1653,26 @@ msgstr "" msgid "Power failure" msgstr "" -#: posix/regex.c:954 +#: posix/regex.c:968 msgid "Premature end of regular expression" msgstr "" +#: db/makedb.c:62 +msgid "Print content of database file, one entry a line" +msgstr "" + +#: locale/programs/localedef.c:112 +msgid "Print more messages" +msgstr "" + +#: nis/nis_error.c:29 +msgid "Probable success" +msgstr "" + +#: nis/nis_error.c:31 +msgid "Probably not found" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:56 #: sysdeps/unix/sysv/linux/siglist.h:46 msgid "Profiling timer expired" @@ -1190,6 +1709,10 @@ msgstr "" msgid "Protocol wrong type for socket" msgstr "" +#: nis/nis_error.c:64 +msgid "Query illegal for named table" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:32 #: sysdeps/unix/sysv/linux/siglist.h:24 msgid "Quit" @@ -1204,7 +1727,7 @@ msgstr "" msgid "RPC bad procedure for program" msgstr "" -#: nis/ypclnt.c:692 +#: nis/ypclnt.c:695 msgid "RPC failure on NIS operation" msgstr "" @@ -1228,83 +1751,87 @@ msgstr "" msgid "RPC version wrong" msgstr "" -#: sunrpc/clnt_perr.c:217 +#: sunrpc/clnt_perr.c:209 msgid "RPC: (unknown error code)" msgstr "" -#: sunrpc/clnt_perr.c:179 +#: sunrpc/clnt_perr.c:170 msgid "RPC: Authentication error" msgstr "" -#: sunrpc/clnt_perr.c:169 +#: sunrpc/clnt_perr.c:160 msgid "RPC: Can't decode result" msgstr "" -#: sunrpc/clnt_perr.c:167 +#: sunrpc/clnt_perr.c:158 msgid "RPC: Can't encode arguments" msgstr "" -#: sunrpc/clnt_perr.c:199 +#: sunrpc/clnt_perr.c:190 msgid "RPC: Failed (unspecified error)" msgstr "" -#: sunrpc/clnt_perr.c:177 +#: sunrpc/clnt_perr.c:168 msgid "RPC: Incompatible versions of RPC" msgstr "" -#: sunrpc/clnt_perr.c:195 +#: sunrpc/clnt_perr.c:186 msgid "RPC: Port mapper failure" msgstr "" -#: sunrpc/clnt_perr.c:185 +#: sunrpc/clnt_perr.c:176 msgid "RPC: Procedure unavailable" msgstr "" -#: sunrpc/clnt_perr.c:197 +#: sunrpc/clnt_perr.c:188 msgid "RPC: Program not registered" msgstr "" -#: sunrpc/clnt_perr.c:181 +#: sunrpc/clnt_perr.c:172 msgid "RPC: Program unavailable" msgstr "" -#: sunrpc/clnt_perr.c:183 +#: sunrpc/clnt_perr.c:174 msgid "RPC: Program/version mismatch" msgstr "" -#: sunrpc/clnt_perr.c:189 +#: sunrpc/clnt_perr.c:180 msgid "RPC: Remote system error" msgstr "" -#: sunrpc/clnt_perr.c:187 +#: sunrpc/clnt_perr.c:178 msgid "RPC: Server can't decode arguments" msgstr "" -#: sunrpc/clnt_perr.c:165 +#: sunrpc/clnt_perr.c:156 msgid "RPC: Success" msgstr "" -#: sunrpc/clnt_perr.c:175 +#: sunrpc/clnt_perr.c:166 msgid "RPC: Timed out" msgstr "" -#: sunrpc/clnt_perr.c:173 +#: sunrpc/clnt_perr.c:164 msgid "RPC: Unable to receive" msgstr "" -#: sunrpc/clnt_perr.c:171 +#: sunrpc/clnt_perr.c:162 msgid "RPC: Unable to send" msgstr "" -#: sunrpc/clnt_perr.c:191 +#: sunrpc/clnt_perr.c:182 msgid "RPC: Unknown host" msgstr "" -#: sunrpc/clnt_perr.c:193 +#: sunrpc/clnt_perr.c:184 msgid "RPC: Unknown protocol" msgstr "" -#: elf/dlsym.c:49 +#: nis/nis_print.c:126 +msgid "RSA.\n" +msgstr "" + +#: elf/dlsym.c:49 elf/dlvsym.c:52 msgid "RTLD_NEXT used in code not dynamically loaded" msgstr "" @@ -1313,7 +1840,7 @@ msgstr "" msgid "Read-only file system" msgstr "" -#: posix/regex.c:955 +#: posix/regex.c:969 msgid "Regular expression too big" msgstr "" @@ -1329,12 +1856,21 @@ msgstr "" msgid "Remove password or make file unreadable by others." msgstr "" -#: catgets/gencat.c:224 db/makedb.c:227 locale/programs/locale.c:257 -#: locale/programs/localedef.c:408 +#: nis/nis_print.c:114 +msgid "Replicate :\n" +msgstr "" + +#: argp/argp-help.c:1565 +#, c-format +msgid "Report bugs to %s.\n" +msgstr "" + +#: catgets/gencat.c:222 db/makedb.c:217 locale/programs/locale.c:254 +#: locale/programs/localedef.c:378 msgid "Report bugs using the `glibcbug' script to .\n" msgstr "" -#: nis/ypclnt.c:690 +#: nis/ypclnt.c:693 msgid "Request arguments bad" msgstr "" @@ -1391,19 +1927,44 @@ msgstr "" msgid "Resource temporarily unavailable" msgstr "" +#: nis/nis_error.c:47 +msgid "Results Sent to callback proc" +msgstr "" + +#: nis/nis_print.c:32 +msgid "SUNYP" +msgstr "" + +#: nis/nis_print.c:202 +#, c-format +msgid "Search Path : %s\n" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:40 #: sysdeps/unix/sysv/linux/siglist.h:31 msgid "Segmentation fault" msgstr "" -#: sunrpc/clnt_perr.c:280 +#: nis/nis_error.c:35 +msgid "Server busy, try again" +msgstr "" + +#: nis/nis_error.c:41 +msgid "Server out of memory" +msgstr "" + +#: sunrpc/clnt_perr.c:277 msgid "Server rejected credential" msgstr "" -#: sunrpc/clnt_perr.c:284 +#: sunrpc/clnt_perr.c:281 msgid "Server rejected verifier" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:38 +msgid "Servname not supported for ai_socktype" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:29 msgid "Signal 0" msgstr "" @@ -1423,6 +1984,14 @@ msgstr "" msgid "Software caused connection abort" msgstr "" +#: locale/programs/localedef.c:102 +msgid "Source definitions are found in FILE" +msgstr "" + +#: locale/programs/localedef.c:104 +msgid "Specify code set for mapping ISO 10646 elements" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:734 msgid "Srmount error" msgstr "" @@ -1439,6 +2008,11 @@ msgstr "" msgid "Stale NFS file handle" msgstr "" +#: nis/nis_print.c:300 +#, c-format +msgid "Status : %s\n" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:47 #: sysdeps/unix/sysv/linux/siglist.h:37 msgid "Stopped" @@ -1467,15 +2041,52 @@ msgstr "" msgid "Structure needs cleaning" msgstr "" -#: nis/ypclnt.c:688 nis/ypclnt.c:762 posix/regex.c:940 +#: nis/nis_error.c:28 nis/ypclnt.c:691 nis/ypclnt.c:765 posix/regex.c:954 #: stdio-common/../sysdeps/gnu/errlist.c:7 msgid "Success" msgstr "" -#: nis/ypclnt.c:768 +#: locale/programs/localedef.c:111 +msgid "Suppress warnings and information messages" +msgstr "" + +#: locale/programs/localedef.c:101 +msgid "Symbolic character names defined in FILE" +msgstr "" + +#: posix/../sysdeps/posix/gai_strerror.c:40 +msgid "System error" +msgstr "" + +#: locale/programs/locale.c:63 +msgid "System information:" +msgstr "" + +#: nis/ypclnt.c:771 msgid "System resource allocation failure" msgstr "" +#: locale/programs/localedef.c:374 +#, c-format +msgid "" +"System's directory for character maps: %s\n" +" locale files : %s\n" +"%s" +msgstr "" + +#: nis/nis_print.c:273 +msgid "TABLE\n" +msgstr "" + +#: nis/nis_print.c:199 +#, c-format +msgid "Table Type : %s\n" +msgstr "" + +#: posix/../sysdeps/posix/gai_strerror.c:31 +msgid "Temporary failure in name resolution" +msgstr "" + #: stdio-common/../sysdeps/unix/siglist.c:44 #: sysdeps/unix/sysv/linux/siglist.h:34 msgid "Terminated" @@ -1490,10 +2101,19 @@ msgstr "" msgid "Text file busy" msgstr "" +#: nis/nis_print.c:164 +#, c-format +msgid "Time to live : %s\n" +msgstr "" + #: stdio-common/../sysdeps/gnu/errlist.c:650 msgid "Timer expired" msgstr "" +#: nis/nis_error.c:55 +msgid "Too Many Attributes" +msgstr "" + #. TRANS Too many levels of symbolic links were encountered in looking up a file name. #. TRANS This often indicates a cycle of symbolic links. #: stdio-common/../sysdeps/gnu/errlist.c:445 @@ -1551,7 +2171,7 @@ msgstr "" msgid "Trace/breakpoint trap" msgstr "" -#: posix/regex.c:945 +#: posix/regex.c:959 msgid "Trailing backslash" msgstr "" @@ -1576,10 +2196,9 @@ msgstr "" msgid "Transport endpoint is not connected" msgstr "" -#: catgets/gencat.c:208 db/makedb.c:209 locale/programs/locale.c:241 -#: locale/programs/localedef.c:389 +#: argp/argp-help.c:1538 #, c-format -msgid "Try `%s --help' for more information.\n" +msgid "Try `%s --help' or `%s --usage' for more information.\n" msgstr "" #: inet/rcmd.c:137 @@ -1587,15 +2206,49 @@ msgstr "" msgid "Trying %s...\n" msgstr "" +#: nis/nis_print.c:219 +#, c-format +msgid "Type : %d\n" +msgstr "" + +#: nis/nis_print.c:107 +#, c-format +msgid "Type : %s\n" +msgstr "" + +#: nis/nis_print.c:46 +msgid "UNKNOWN" +msgstr "" + +#: nis/nis_error.c:72 +msgid "Unable to authenticate NIS+ client" +msgstr "" + +#: nis/nis_error.c:71 +msgid "Unable to authenticate NIS+ server" +msgstr "" + +#: nis/nis_error.c:46 +msgid "Unable to create callback" +msgstr "" + +#: nis/nis_error.c:74 +msgid "Unable to create process on server" +msgstr "" + #: inet/ruserpass.c:246 #, c-format msgid "Unknown .netrc keyword %s" msgstr "" -#: nis/ypclnt.c:722 +#: nis/ypclnt.c:725 msgid "Unknown NIS error code" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:51 +msgid "Unknown error" +msgstr "" + #: string/../sysdeps/generic/_strerror.c:44 #: string/../sysdeps/mach/_strerror.c:67 msgid "Unknown error " @@ -1605,6 +2258,10 @@ msgstr "" msgid "Unknown host" msgstr "" +#: nis/nis_error.c:34 +msgid "Unknown object" +msgstr "" + #: resolv/herror.c:120 msgid "Unknown resolver error" msgstr "" @@ -1618,27 +2275,31 @@ msgstr "" msgid "Unknown signal %d" msgstr "" -#: misc/error.c:95 +#: misc/error.c:100 msgid "Unknown system error" msgstr "" -#: nis/ypclnt.c:770 +#: nis/ypclnt.c:773 msgid "Unknown ypbind error" msgstr "" -#: posix/regex.c:948 +#: nis/nis_print.c:132 +msgid "Unknown.\n" +msgstr "" + +#: posix/regex.c:962 msgid "Unmatched ( or \\(" msgstr "" -#: posix/regex.c:956 +#: posix/regex.c:970 msgid "Unmatched ) or \\)" msgstr "" -#: posix/regex.c:947 +#: posix/regex.c:961 msgid "Unmatched [ or [^" msgstr "" -#: posix/regex.c:949 +#: posix/regex.c:963 msgid "Unmatched \\{" msgstr "" @@ -1652,77 +2313,12 @@ msgstr "" msgid "Urgent I/O condition" msgstr "" -#: catgets/gencat.c:212 -#, c-format -msgid "" -"Usage: %s [OPTION]... -o OUTPUT-FILE [INPUT-FILE]...\n" -" %s [OPTION]... [OUTPUT-FILE [INPUT-FILE]...]\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -H, --header create C header file containing symbol definitions\n" -" -h, --help display this help and exit\n" -" --new do not use existing catalog, force new output file\n" -" -o, --output=NAME write output to file NAME\n" -" -V, --version output version information and exit\n" -"If INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" -"is -, output is written to standard output.\n" -msgstr "" - -#: db/makedb.c:213 -#, c-format -msgid "" -"Usage: %s [OPTION]... INPUT-FILE OUTPUT-FILE\n" -" %s [OPTION]... -o OUTPUT-FILE INPUT-FILE\n" -" %s [OPTION]... -u INPUT-FILE\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -f, --fold-case convert key to lower case\n" -" -h, --help display this help and exit\n" -" -o, --output=NAME write output to file NAME\n" -" --quiet don't print messages while building database\n" -" -u, --undo print content of database file, one entry a line\n" -" -V, --version output version information and exit\n" -"If INPUT-FILE is -, input is read from standard input.\n" -msgstr "" - -#: locale/programs/localedef.c:393 -#, c-format -msgid "" -"Usage: %s [OPTION]... name\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -c, --force create output even if warning messages were " -"issued\n" -" -h, --help display this help and exit\n" -" -f, --charmap=FILE symbolic character names defined in FILE\n" -" -i, --inputfile=FILE source definitions are found in FILE\n" -" -u, --code-set-name=NAME specify code set for mapping ISO 10646 elements\n" -" -v, --verbose print more messages\n" -" -V, --version output version information and exit\n" -" --posix be strictly POSIX conform\n" -"\n" -"System's directory for character maps: %s\n" -" locale files : %s\n" -msgstr "" - -#: locale/programs/locale.c:245 -#, c-format -msgid "" -"Usage: %s [OPTION]... name\n" -"Mandatory arguments to long options are mandatory for short options too.\n" -" -h, --help display this help and exit\n" -" -V, --version output version information and exit\n" -"\n" -" -a, --all-locales write names of available locales\n" -" -m, --charmaps write names of available charmaps\n" -"\n" -" -c, --category-name write names of selected categories\n" -" -k, --keyword-name write names of selected keywords\n" -msgstr "" - #: posix/getconf.c:200 #, c-format msgid "Usage: %s variable_name [pathname]\n" msgstr "" -#: sunrpc/rpcinfo.c:609 +#: sunrpc/rpcinfo.c:677 msgid "Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n" msgstr "" @@ -1745,7 +2341,7 @@ msgstr "" msgid "Virtual timer expired" msgstr "" -#: time/zic.c:1859 +#: time/zic.c:1871 msgid "Wild result from command execution" msgstr "" @@ -1754,12 +2350,40 @@ msgstr "" msgid "Window changed" msgstr "" -#: catgets/gencat.c:174 db/makedb.c:125 locale/programs/locale.c:192 -#: locale/programs/localedef.c:182 +#: locale/programs/locale.c:67 +msgid "Write names of available charmaps" +msgstr "" + +#: locale/programs/locale.c:65 +msgid "Write names of available locales" +msgstr "" + +#: locale/programs/locale.c:69 +msgid "Write names of selected categories" +msgstr "" + +#: locale/programs/locale.c:70 +msgid "Write names of selected keywords" +msgstr "" + +#: catgets/gencat.c:110 db/makedb.c:58 +msgid "Write output to file NAME" +msgstr "" + +#: catgets/gencat.c:240 db/makedb.c:235 locale/programs/locale.c:272 +#: locale/programs/localedef.c:397 #, c-format msgid "Written by %s.\n" msgstr "" +#: nis/nis_print.c:38 +msgid "X500" +msgstr "" + +#: nis/nis_print.c:42 +msgid "XCHS" +msgstr "" + #: nis/ypclnt.c:142 msgid "YPBINDPROC_DOMAIN: Internal error\n" msgstr "" @@ -1777,44 +2401,62 @@ msgstr "" msgid "YPBINDPROC_DOMAIN: Unknown error\n" msgstr "" +#: nis/nis_error.c:70 +msgid "Yes, 42 is the meaning of life" +msgstr "" + #. TRANS You did @strong{what}? #: stdio-common/../sysdeps/gnu/errlist.c:596 msgid "You really blew it this time" msgstr "" -#: time/zic.c:1054 +#: time/zic.c:1048 msgid "Zone continuation line end time is not after end time of previous line" msgstr "" -#: locale/programs/charmap.c:397 locale/programs/locfile.c:341 +#: nis/nis_server.c:36 nis/nis_server.c:48 nis/nis_server.c:68 +#: nis/nis_server.c:80 +#, c-format +msgid "__do_niscall: Error #%d\n" +msgstr "" + +#: locale/programs/charmap.c:397 locale/programs/locfile.c:363 #, c-format msgid "`%1$s' definition does not end with `END %1$s'" msgstr "" -#: locale/programs/ld-monetary.c:358 locale/programs/ld-numeric.c:190 +#: locale/programs/ld-monetary.c:359 locale/programs/ld-numeric.c:190 #, c-format msgid "`-1' must be last entry in `%s' field in `%s' category" msgstr "" -#: locale/programs/ld-collate.c:1652 +#: locale/programs/ld-collate.c:1655 msgid "`...' must only be used in `...' and `UNDEFINED' entries" msgstr "" -#: locale/programs/locfile.c:538 +#: locale/programs/locfile.c:560 msgid "`from' expected after first argument to `collating-element'" msgstr "" -#: locale/programs/ld-collate.c:1109 +#: locale/programs/ld-collate.c:1112 msgid "" "`from' string in collation element declaration contains unknown character" msgstr "" +#: posix/../sysdeps/posix/gai_strerror.c:34 +msgid "ai_family not supported" +msgstr "" + +#: posix/../sysdeps/posix/gai_strerror.c:39 +msgid "ai_socktype not supported" +msgstr "" + #: locale/programs/charmap.c:267 #, c-format msgid "argument to <%s> must be a single character" msgstr "" -#: locale/programs/locfile.c:215 +#: locale/programs/locfile.c:237 #, c-format msgid "argument to `%s' must be a single character" msgstr "" @@ -1823,19 +2465,23 @@ msgstr "" msgid "auth_none.c - Fatal marshalling problem" msgstr "" -#: inet/rcmd.c:361 +#: sunrpc/auth_unix.c:118 sunrpc/auth_unix.c:124 sunrpc/auth_unix.c:153 +msgid "authunix_create: out of memory\n" +msgstr "" + +#: inet/rcmd.c:365 msgid "bad .rhosts owner" msgstr "" -#: locale/programs/charmap.c:212 locale/programs/locfile.c:209 +#: locale/programs/charmap.c:212 locale/programs/locfile.c:231 msgid "bad argument" msgstr "" -#: time/zic.c:1176 +#: time/zic.c:1170 msgid "blank FROM field on Link line" msgstr "" -#: time/zic.c:1180 +#: time/zic.c:1174 msgid "blank TO field on Link line" msgstr "" @@ -1847,129 +2493,137 @@ msgstr "" msgid "bogus mcheck_status, library is buggy" msgstr "" -#: sunrpc/pmap_rmt.c:179 +#: sunrpc/pmap_rmt.c:183 msgid "broadcast: ioctl (get interface configuration)" msgstr "" -#: sunrpc/pmap_rmt.c:186 +#: sunrpc/pmap_rmt.c:192 msgid "broadcast: ioctl (get interface flags)" msgstr "" -#: sunrpc/svc_udp.c:402 +#: sunrpc/svc_udp.c:439 +msgid "cache_set: could not allocate new rpc_buffer" +msgstr "" + +#: sunrpc/svc_udp.c:433 +msgid "cache_set: victim alloc failed" +msgstr "" + +#: sunrpc/svc_udp.c:422 msgid "cache_set: victim not found" msgstr "" -#: time/zic.c:1700 +#: time/zic.c:1698 msgid "can't determine time zone abbreviation to use just after until time" msgstr "" -#: sunrpc/svc_simple.c:64 +#: sunrpc/svc_simple.c:70 #, c-format msgid "can't reassign procedure number %d\n" msgstr "" -#: locale/programs/localedef.c:287 +#: locale/programs/localedef.c:271 #, c-format msgid "cannot `stat' locale file `%s'" msgstr "" -#: locale/programs/ld-collate.c:1314 +#: locale/programs/ld-collate.c:1317 #, c-format msgid "cannot insert collation element `%.*s'" msgstr "" -#: locale/programs/ld-collate.c:1493 locale/programs/ld-collate.c:1498 +#: locale/programs/ld-collate.c:1496 locale/programs/ld-collate.c:1501 msgid "cannot insert into result table" msgstr "" -#: locale/programs/ld-collate.c:1166 locale/programs/ld-collate.c:1208 +#: locale/programs/ld-collate.c:1169 locale/programs/ld-collate.c:1211 #, c-format msgid "cannot insert new collating symbol definition: %s" msgstr "" -#: db/makedb.c:161 +#: db/makedb.c:142 #, c-format msgid "cannot open database file `%s': %s" msgstr "" -#: catgets/gencat.c:260 db/makedb.c:180 +#: catgets/gencat.c:271 db/makedb.c:161 #, c-format msgid "cannot open input file `%s'" msgstr "" -#: locale/programs/localedef.c:221 +#: locale/programs/localedef.c:203 #, c-format msgid "cannot open locale definition file `%s'" msgstr "" -#: catgets/gencat.c:765 catgets/gencat.c:806 db/makedb.c:189 +#: catgets/gencat.c:776 catgets/gencat.c:817 db/makedb.c:170 #, c-format msgid "cannot open output file `%s'" msgstr "" -#: locale/programs/locfile.c:986 +#: locale/programs/locfile.c:1008 #, c-format msgid "cannot open output file `%s' for category `%s'" msgstr "" -#: locale/programs/ld-collate.c:1360 +#: locale/programs/ld-collate.c:1363 msgid "cannot process order specification" msgstr "" -#: locale/programs/locale.c:304 +#: locale/programs/locale.c:449 #, c-format msgid "cannot read character map directory `%s'" msgstr "" -#: locale/programs/locale.c:279 +#: locale/programs/locale.c:306 #, c-format msgid "cannot read locale directory `%s'" msgstr "" -#: locale/programs/localedef.c:309 +#: locale/programs/localedef.c:293 #, c-format msgid "cannot read locale file `%s'" msgstr "" -#: locale/programs/localedef.c:334 +#: locale/programs/localedef.c:318 #, c-format msgid "cannot write output files to `%s'" msgstr "" -#: locale/programs/localedef.c:377 +#: locale/programs/localedef.c:431 msgid "category data requested more than once: should not happen" msgstr "" -#: locale/programs/ld-ctype.c:265 +#: locale/programs/ld-ctype.c:266 #, c-format msgid "character %s'%s' in class `%s' must be in class `%s'" msgstr "" -#: locale/programs/ld-ctype.c:289 +#: locale/programs/ld-ctype.c:291 #, c-format msgid "character %s'%s' in class `%s' must not be in class `%s'" msgstr "" -#: locale/programs/ld-ctype.c:310 +#: locale/programs/ld-ctype.c:313 msgid "character not defined in character map" msgstr "" -#: locale/programs/ld-ctype.c:939 locale/programs/ld-ctype.c:1002 -#: locale/programs/ld-ctype.c:1010 locale/programs/ld-ctype.c:1018 -#: locale/programs/ld-ctype.c:1026 locale/programs/ld-ctype.c:1034 -#: locale/programs/ld-ctype.c:1042 locale/programs/ld-ctype.c:1068 -#: locale/programs/ld-ctype.c:1076 locale/programs/ld-ctype.c:1114 -#: locale/programs/ld-ctype.c:1141 locale/programs/ld-ctype.c:1152 +#: locale/programs/ld-ctype.c:944 locale/programs/ld-ctype.c:1007 +#: locale/programs/ld-ctype.c:1015 locale/programs/ld-ctype.c:1023 +#: locale/programs/ld-ctype.c:1031 locale/programs/ld-ctype.c:1039 +#: locale/programs/ld-ctype.c:1047 locale/programs/ld-ctype.c:1073 +#: locale/programs/ld-ctype.c:1081 locale/programs/ld-ctype.c:1119 +#: locale/programs/ld-ctype.c:1146 locale/programs/ld-ctype.c:1157 #, c-format msgid "character `%s' not defined while needed as default value" msgstr "" -#: locale/programs/ld-ctype.c:801 +#: locale/programs/ld-ctype.c:806 #, c-format msgid "character class `%s' already defined" msgstr "" -#: locale/programs/ld-ctype.c:833 +#: locale/programs/ld-ctype.c:838 #, c-format msgid "character map `%s' already defined" msgstr "" @@ -1979,21 +2633,29 @@ msgstr "" msgid "character map file `%s' not found" msgstr "" -#: sunrpc/clnt_raw.c:106 +#: sunrpc/clnt_raw.c:112 msgid "clnt_raw.c - Fatal header serialization error." msgstr "" -#: locale/programs/ld-collate.c:1329 +#: sunrpc/clnt_tcp.c:125 sunrpc/clnt_tcp.c:133 +msgid "clnttcp_create: out of memory\n" +msgstr "" + +#: sunrpc/clnt_udp.c:128 sunrpc/clnt_udp.c:138 +msgid "clntudp_create: out of memory\n" +msgstr "" + +#: locale/programs/ld-collate.c:1332 #, c-format msgid "collation element `%.*s' appears more than once: ignore line" msgstr "" -#: locale/programs/ld-collate.c:1347 +#: locale/programs/ld-collate.c:1350 #, c-format msgid "collation symbol `%.*s' appears more than once: ignore line" msgstr "" -#: locale/programs/locfile.c:522 +#: locale/programs/locfile.c:544 #, c-format msgid "collation symbol expected after `%s'" msgstr "" @@ -2003,11 +2665,11 @@ msgstr "" msgid "connect to address %s: " msgstr "" -#: sunrpc/svc_simple.c:70 +#: sunrpc/svc_simple.c:78 msgid "couldn't create an rpc server\n" msgstr "" -#: sunrpc/svc_simple.c:77 +#: sunrpc/svc_simple.c:86 #, c-format msgid "couldn't register prog %d vers %d\n" msgstr "" @@ -2017,14 +2679,14 @@ msgstr "" msgid "default character map file `%s' not found" msgstr "" -#: locale/programs/ld-time.c:154 +#: locale/programs/ld-time.c:159 #, c-format msgid "" "direction flag in string %d in `era' field in category `%s' is not '+' nor " "'-'" msgstr "" -#: locale/programs/ld-time.c:164 +#: locale/programs/ld-time.c:169 #, c-format msgid "" "direction flag in string %d in `era' field in category `%s' is not a single " @@ -2036,86 +2698,90 @@ msgstr "" msgid "duplicate character name `%s'" msgstr "" -#: locale/programs/ld-collate.c:1141 +#: locale/programs/ld-collate.c:1144 msgid "duplicate collating element definition" msgstr "" -#: locale/programs/ld-collate.c:1287 +#: locale/programs/ld-collate.c:1290 #, c-format msgid "duplicate definition for character `%.*s'" msgstr "" -#: db/makedb.c:311 +#: db/makedb.c:314 msgid "duplicate key" msgstr "" -#: catgets/gencat.c:379 +#: catgets/gencat.c:390 msgid "duplicate set definition" msgstr "" -#: time/zic.c:969 +#: time/zic.c:963 #, c-format msgid "duplicate zone name %s (file \"%s\", line %d)" msgstr "" -#: catgets/gencat.c:542 +#: catgets/gencat.c:553 msgid "duplicated message identifier" msgstr "" -#: catgets/gencat.c:515 +#: catgets/gencat.c:526 msgid "duplicated message number" msgstr "" -#: locale/programs/ld-collate.c:1696 +#: sunrpc/rpc_scan.c:384 +msgid "empty char string" +msgstr "" + +#: locale/programs/ld-collate.c:1699 msgid "empty weight name: line ignored" msgstr "" -#: sunrpc/svc_udp.c:348 +#: sunrpc/svc_udp.c:365 msgid "enablecache: cache already enabled" msgstr "" -#: sunrpc/svc_udp.c:353 +#: sunrpc/svc_udp.c:371 msgid "enablecache: could not allocate cache" msgstr "" -#: sunrpc/svc_udp.c:360 +#: sunrpc/svc_udp.c:379 msgid "enablecache: could not allocate cache data" msgstr "" -#: sunrpc/svc_udp.c:366 +#: sunrpc/svc_udp.c:386 msgid "enablecache: could not allocate cache fifo" msgstr "" -#: locale/programs/ld-collate.c:1419 +#: locale/programs/ld-collate.c:1422 msgid "end point of ellipsis range is bigger then start" msgstr "" -#: locale/programs/ld-collate.c:1149 +#: locale/programs/ld-collate.c:1152 msgid "error while inserting collation element into hash table" msgstr "" -#: locale/programs/ld-collate.c:1161 +#: locale/programs/ld-collate.c:1164 msgid "error while inserting to hash table" msgstr "" -#: locale/programs/locfile.c:465 +#: locale/programs/locfile.c:487 msgid "expect string argument for `copy'" msgstr "" -#: time/zic.c:860 +#: time/zic.c:854 msgid "expected continuation line not found" msgstr "" -#: locale/programs/locfile.c:1010 +#: locale/programs/locfile.c:1032 #, c-format msgid "failure while writing data for category `%s'" msgstr "" -#: nis/ypclnt.c:186 +#: nis/ypclnt.c:187 msgid "fcntl: F_SETFD" msgstr "" -#: locale/programs/ld-monetary.c:154 locale/programs/ld-numeric.c:95 +#: locale/programs/ld-monetary.c:155 locale/programs/ld-numeric.c:95 #, c-format msgid "field `%s' in category `%s' not defined" msgstr "" @@ -2125,53 +2791,57 @@ msgstr "" msgid "field `%s' in category `%s' undefined" msgstr "" -#: locale/programs/locfile.c:547 +#: locale/programs/locfile.c:569 msgid "from-value of `collating-element' must be a string" msgstr "" -#: locale/programs/linereader.c:328 +#: locale/programs/linereader.c:327 msgid "garbage at end of character code specification" msgstr "" -#: locale/programs/linereader.c:214 +#: locale/programs/linereader.c:213 msgid "garbage at end of number" msgstr "" -#: locale/programs/ld-time.c:183 +#: locale/programs/ld-time.c:188 #, c-format msgid "" "garbage at end of offset value in string %d in `era' field in category `%s'" msgstr "" -#: locale/programs/ld-time.c:238 +#: locale/programs/ld-time.c:243 #, c-format msgid "" "garbage at end of starting date in string %d in `era' field in category `%s'" msgstr "" -#: locale/programs/ld-time.c:310 +#: locale/programs/ld-time.c:316 #, c-format msgid "" "garbage at end of stopping date in string %d in `era' field in category `%s'" msgstr "" -#: sunrpc/get_myaddr.c:73 +#: sunrpc/get_myaddr.c:75 msgid "get_myaddress: ioctl (get interface configuration)" msgstr "" -#: time/zic.c:1153 +#: time/zic.c:1147 msgid "illegal CORRECTION field on Leap line" msgstr "" -#: time/zic.c:1157 +#: time/zic.c:1151 msgid "illegal Rolling/Stationary field on Leap line" msgstr "" -#: locale/programs/ld-collate.c:1767 +#: locale/programs/ld-collate.c:1770 msgid "illegal character constant in string" msgstr "" -#: locale/programs/ld-collate.c:1116 +#: sunrpc/rpc_scan.c:313 +msgid "illegal character in file: " +msgstr "" + +#: locale/programs/ld-collate.c:1119 msgid "illegal collation element" msgstr "" @@ -2183,7 +2853,7 @@ msgstr "" msgid "illegal encoding given" msgstr "" -#: locale/programs/linereader.c:546 +#: locale/programs/linereader.c:545 msgid "illegal escape sequence at end of string" msgstr "" @@ -2191,118 +2861,118 @@ msgstr "" msgid "illegal names for character range" msgstr "" -#: locale/programs/ld-time.c:176 +#: locale/programs/ld-time.c:181 #, c-format msgid "illegal number for offset in string %d in `era' field in category `%s'" msgstr "" -#: catgets/gencat.c:352 catgets/gencat.c:429 +#: catgets/gencat.c:363 catgets/gencat.c:440 msgid "illegal set number" msgstr "" -#: locale/programs/ld-time.c:230 +#: locale/programs/ld-time.c:235 #, c-format msgid "illegal starting date in string %d in `era' field in category `%s'" msgstr "" -#: locale/programs/ld-time.c:302 +#: locale/programs/ld-time.c:308 #, c-format msgid "illegal stopping date in string %d in `era' field in category `%s'" msgstr "" -#: locale/programs/ld-ctype.c:807 +#: locale/programs/ld-ctype.c:812 #, c-format msgid "implementation limit: no more than %d character classes allowed" msgstr "" -#: locale/programs/ld-ctype.c:839 +#: locale/programs/ld-ctype.c:844 #, c-format msgid "implementation limit: no more than %d character maps allowed" msgstr "" -#: db/makedb.c:163 +#: db/makedb.c:144 msgid "incorrectly formatted file" msgstr "" -#: time/zic.c:817 +#: time/zic.c:811 msgid "input line of unknown type" msgstr "" -#: time/zic.c:1748 +#: time/zic.c:1760 msgid "internal error - addtype called with bad isdst" msgstr "" -#: time/zic.c:1756 +#: time/zic.c:1768 msgid "internal error - addtype called with bad ttisgmt" msgstr "" -#: time/zic.c:1752 +#: time/zic.c:1764 msgid "internal error - addtype called with bad ttisstd" msgstr "" -#: locale/programs/ld-ctype.c:301 +#: locale/programs/ld-ctype.c:304 #, c-format msgid "internal error in %s, line %u" msgstr "" -#: time/zic.c:1025 +#: time/zic.c:1019 msgid "invalid GMT offset" msgstr "" -#: time/zic.c:1028 +#: time/zic.c:1022 msgid "invalid abbreviation format" msgstr "" -#: time/zic.c:1118 time/zic.c:1317 time/zic.c:1331 +#: time/zic.c:1112 time/zic.c:1313 time/zic.c:1327 msgid "invalid day of month" msgstr "" -#: time/zic.c:1276 +#: time/zic.c:1270 msgid "invalid ending year" msgstr "" -#: time/zic.c:1090 +#: time/zic.c:1084 msgid "invalid leaping year" msgstr "" -#: time/zic.c:1105 time/zic.c:1208 +#: time/zic.c:1099 time/zic.c:1202 msgid "invalid month name" msgstr "" -#: time/zic.c:924 +#: time/zic.c:918 msgid "invalid saved time" msgstr "" -#: time/zic.c:1256 +#: time/zic.c:1250 msgid "invalid starting year" msgstr "" -#: time/zic.c:1134 time/zic.c:1236 +#: time/zic.c:1128 time/zic.c:1230 msgid "invalid time of day" msgstr "" -#: time/zic.c:1322 +#: time/zic.c:1318 msgid "invalid weekday name" msgstr "" -#: locale/programs/ld-collate.c:1412 +#: locale/programs/ld-collate.c:1415 msgid "line after ellipsis must contain character definition" msgstr "" -#: locale/programs/ld-collate.c:1391 +#: locale/programs/ld-collate.c:1394 msgid "line before ellipsis does not contain definition for character constant" msgstr "" -#: time/zic.c:797 +#: time/zic.c:791 msgid "line too long" msgstr "" -#: locale/programs/localedef.c:281 +#: locale/programs/localedef.c:265 #, c-format msgid "locale file `%s', used in `copy' statement, not found" msgstr "" -#: catgets/gencat.c:610 +#: catgets/gencat.c:621 msgid "malformed line ignored" msgstr "" @@ -2315,8 +2985,8 @@ msgid "memory clobbered past end of allocated block" msgstr "" #: locale/programs/ld-collate.c:167 locale/programs/ld-collate.c:173 -#: locale/programs/ld-collate.c:177 locale/programs/ld-collate.c:1439 -#: locale/programs/ld-collate.c:1468 locale/programs/locfile.c:940 +#: locale/programs/ld-collate.c:177 locale/programs/ld-collate.c:1442 +#: locale/programs/ld-collate.c:1471 locale/programs/locfile.c:962 #: locale/programs/xmalloc.c:68 posix/getconf.c:250 msgid "memory exhausted" msgstr "" @@ -2329,21 +2999,25 @@ msgstr "" msgid "memory is consistent, library is buggy" msgstr "" -#: locale/programs/ld-time.c:348 +#: locale/programs/ld-time.c:355 #, c-format msgid "missing era format in string %d in `era' field in category `%s'" msgstr "" -#: locale/programs/ld-time.c:337 +#: locale/programs/ld-time.c:344 #, c-format msgid "missing era name in string %d in `era' field in category `%s'" msgstr "" -#: time/zic.c:919 +#: gmon/gmon.c:128 +msgid "monstartup: out of memory\n" +msgstr "" + +#: time/zic.c:913 msgid "nameless rule" msgstr "" -#: sunrpc/svc_simple.c:140 +#: sunrpc/svc_simple.c:153 #, c-format msgid "never registered prog %d\n" msgstr "" @@ -2353,19 +3027,19 @@ msgstr "" msgid "no correct regular expression for field `%s' in category `%s': %s" msgstr "" -#: time/zic.c:2074 +#: time/zic.c:2086 msgid "no day in month matches rule" msgstr "" -#: locale/programs/ld-collate.c:259 +#: locale/programs/ld-collate.c:260 msgid "no definition of `UNDEFINED'" msgstr "" -#: locale/programs/locfile.c:479 +#: locale/programs/locfile.c:501 msgid "no other keyword shall be specified when `copy' is used" msgstr "" -#: locale/programs/localedef.c:340 +#: locale/programs/localedef.c:324 msgid "no output file produced because warning were issued" msgstr "" @@ -2388,23 +3062,31 @@ msgstr "" msgid "only WIDTH definitions are allowed to follow the CHARMAP definition" msgstr "" -#: db/makedb.c:327 +#: sunrpc/pm_getmaps.c:73 +msgid "pmap_getmaps rpc problem" +msgstr "" + +#: sunrpc/rpc_scan.c:525 sunrpc/rpc_scan.c:535 +msgid "preprocessor error" +msgstr "" + +#: db/makedb.c:330 #, c-format msgid "problems while reading `%s'" msgstr "" -#: sunrpc/rpcinfo.c:222 sunrpc/rpcinfo.c:350 +#: sunrpc/rpcinfo.c:237 sunrpc/rpcinfo.c:384 #, c-format msgid "program %lu is not available\n" msgstr "" -#: sunrpc/rpcinfo.c:245 sunrpc/rpcinfo.c:282 sunrpc/rpcinfo.c:371 -#: sunrpc/rpcinfo.c:408 sunrpc/rpcinfo.c:429 sunrpc/rpcinfo.c:462 +#: sunrpc/rpcinfo.c:265 sunrpc/rpcinfo.c:311 sunrpc/rpcinfo.c:409 +#: sunrpc/rpcinfo.c:455 sunrpc/rpcinfo.c:478 sunrpc/rpcinfo.c:512 #, c-format msgid "program %lu version %lu is not available\n" msgstr "" -#: sunrpc/rpcinfo.c:466 +#: sunrpc/rpcinfo.c:518 #, c-format msgid "program %lu version %lu ready and waiting\n" msgstr "" @@ -2423,43 +3105,43 @@ msgstr "" msgid "rcmd: write (setting up stderr): %m\n" msgstr "" -#: sunrpc/svc_simple.c:83 +#: sunrpc/svc_simple.c:93 msgid "registerrpc: out of memory\n" msgstr "" -#: time/zic.c:1809 +#: time/zic.c:1821 msgid "repeated leap second moment" msgstr "" -#: sunrpc/rpcinfo.c:659 +#: sunrpc/rpcinfo.c:733 #, c-format msgid "rpcinfo: %s is unknown host\n" msgstr "" -#: sunrpc/rpcinfo.c:626 +#: sunrpc/rpcinfo.c:696 #, c-format msgid "rpcinfo: %s is unknown service\n" msgstr "" -#: sunrpc/rpcinfo.c:600 +#: sunrpc/rpcinfo.c:668 #, c-format msgid "rpcinfo: Could not delete registration for prog %s version %s\n" msgstr "" -#: sunrpc/rpcinfo.c:576 +#: sunrpc/rpcinfo.c:640 #, c-format msgid "rpcinfo: broadcast failed: %s\n" msgstr "" -#: sunrpc/rpcinfo.c:505 +#: sunrpc/rpcinfo.c:560 msgid "rpcinfo: can't contact portmapper" msgstr "" -#: sunrpc/rpcinfo.c:510 +#: sunrpc/rpcinfo.c:567 msgid "rpcinfo: can't contact portmapper: " msgstr "" -#: time/zic.c:710 time/zic.c:712 +#: time/zic.c:704 time/zic.c:706 msgid "same rule name in multiple files" msgstr "" @@ -2471,90 +3153,98 @@ msgstr "" msgid "socket: protocol failure in circuit setup\n" msgstr "" -#: locale/programs/locfile.c:600 +#: locale/programs/locfile.c:622 msgid "sorting order `forward' and `backward' are mutually exclusive" msgstr "" -#: locale/programs/ld-collate.c:1568 locale/programs/ld-collate.c:1614 +#: locale/programs/ld-collate.c:1571 locale/programs/ld-collate.c:1617 msgid "" "specification of sorting weight for collation symbol does not make sense" msgstr "" -#: time/zic.c:781 +#: time/zic.c:775 msgid "standard input" msgstr "" -#: time/zdump.c:260 +#: time/zdump.c:268 msgid "standard output" msgstr "" -#: locale/programs/ld-time.c:256 +#: locale/programs/ld-time.c:262 #, c-format msgid "starting date is illegal in string %d in `era' field in category `%s'" msgstr "" -#: time/zic.c:1280 +#: time/zic.c:1274 msgid "starting year greater than ending year" msgstr "" -#: locale/programs/ld-time.c:328 +#: locale/programs/ld-time.c:335 #, c-format msgid "stopping date is illegal in string %d in `era' field in category `%s'" msgstr "" -#: sunrpc/svc_tcp.c:201 sunrpc/svc_tcp.c:206 +#: sunrpc/svc_run.c:66 +msgid "svc_run: - select failed" +msgstr "" + +#: sunrpc/svc_tcp.c:202 sunrpc/svc_tcp.c:208 msgid "svc_tcp: makefd_xprt: out of memory\n" msgstr "" -#: sunrpc/svc_tcp.c:149 +#: sunrpc/svc_tcp.c:154 msgid "svctcp_.c - cannot getsockname or listen" msgstr "" -#: sunrpc/svc_tcp.c:136 +#: sunrpc/svc_tcp.c:139 msgid "svctcp_.c - udp socket creation problem" msgstr "" -#: sunrpc/svc_tcp.c:156 sunrpc/svc_tcp.c:163 +#: sunrpc/svc_tcp.c:162 sunrpc/svc_tcp.c:170 msgid "svctcp_create: out of memory\n" msgstr "" -#: sunrpc/svc_udp.c:123 +#: sunrpc/svc_udp.c:131 msgid "svcudp_create - cannot getsockname" msgstr "" -#: sunrpc/svc_udp.c:111 +#: sunrpc/svc_udp.c:139 sunrpc/svc_udp.c:145 sunrpc/svc_udp.c:151 +msgid "svcudp_create: out of memory\n" +msgstr "" + +#: sunrpc/svc_udp.c:117 msgid "svcudp_create: socket creation problem" msgstr "" -#: locale/programs/ld-collate.c:1191 +#: locale/programs/ld-collate.c:1194 #, c-format msgid "" "symbol for multicharacter collating element `%.*s' duplicates element " "definition" msgstr "" -#: locale/programs/ld-collate.c:1064 +#: locale/programs/ld-collate.c:1067 #, c-format msgid "" "symbol for multicharacter collating element `%.*s' duplicates other element " "definition" msgstr "" -#: locale/programs/ld-collate.c:1200 +#: locale/programs/ld-collate.c:1203 #, c-format msgid "" "symbol for multicharacter collating element `%.*s' duplicates other symbol " "definition" msgstr "" -#: locale/programs/ld-collate.c:1073 +#: locale/programs/ld-collate.c:1076 #, c-format msgid "" "symbol for multicharacter collating element `%.*s' duplicates symbol " "definition" msgstr "" -#: locale/programs/ld-collate.c:1055 locale/programs/ld-collate.c:1182 +#: locale/programs/ld-collate.c:1058 locale/programs/ld-collate.c:1185 #, c-format msgid "" "symbol for multicharacter collating element `%.*s' duplicates symbolic name " @@ -2569,51 +3259,51 @@ msgstr "" msgid "syntax error in %s definition: %s" msgstr "" -#: locale/programs/locfile.c:620 +#: locale/programs/locfile.c:642 msgid "syntax error in `order_start' directive" msgstr "" -#: locale/programs/locfile.c:362 +#: locale/programs/locfile.c:384 msgid "syntax error in character class definition" msgstr "" -#: locale/programs/locfile.c:420 +#: locale/programs/locfile.c:442 msgid "syntax error in character conversion definition" msgstr "" -#: locale/programs/locfile.c:662 +#: locale/programs/locfile.c:684 msgid "syntax error in collating order definition" msgstr "" -#: locale/programs/locfile.c:512 +#: locale/programs/locfile.c:534 msgid "syntax error in collation definition" msgstr "" -#: locale/programs/locfile.c:335 +#: locale/programs/locfile.c:357 msgid "syntax error in definition of LC_CTYPE category" msgstr "" -#: locale/programs/locfile.c:278 +#: locale/programs/locfile.c:300 msgid "syntax error in definition of new character class" msgstr "" -#: locale/programs/locfile.c:288 +#: locale/programs/locfile.c:310 msgid "syntax error in definition of new character map" msgstr "" -#: locale/programs/locfile.c:873 +#: locale/programs/locfile.c:895 msgid "syntax error in message locale definition" msgstr "" -#: locale/programs/locfile.c:784 +#: locale/programs/locfile.c:806 msgid "syntax error in monetary locale definition" msgstr "" -#: locale/programs/locfile.c:811 +#: locale/programs/locfile.c:833 msgid "syntax error in numeric locale definition" msgstr "" -#: locale/programs/locfile.c:722 +#: locale/programs/locfile.c:744 msgid "syntax error in order specification" msgstr "" @@ -2622,23 +3312,23 @@ msgstr "" msgid "syntax error in prolog: %s" msgstr "" -#: locale/programs/locfile.c:849 +#: locale/programs/locfile.c:871 msgid "syntax error in time locale definition" msgstr "" -#: locale/programs/locfile.c:255 +#: locale/programs/locfile.c:277 msgid "syntax error: not inside a locale definition section" msgstr "" -#: catgets/gencat.c:381 catgets/gencat.c:517 catgets/gencat.c:544 +#: catgets/gencat.c:392 catgets/gencat.c:528 catgets/gencat.c:555 msgid "this is the first definition" msgstr "" -#: time/zic.c:1123 +#: time/zic.c:1117 msgid "time before zero" msgstr "" -#: time/zic.c:1131 time/zic.c:1974 time/zic.c:1993 +#: time/zic.c:1125 time/zic.c:1986 time/zic.c:2005 msgid "time overflow" msgstr "" @@ -2654,23 +3344,23 @@ msgstr "" msgid "too many character classes defined" msgstr "" -#: time/zic.c:1803 +#: time/zic.c:1815 msgid "too many leap seconds" msgstr "" -#: time/zic.c:1775 +#: time/zic.c:1787 msgid "too many local time types" msgstr "" -#: time/zic.c:1729 +#: time/zic.c:1741 msgid "too many transitions?!" msgstr "" -#: locale/programs/ld-collate.c:1623 +#: locale/programs/ld-collate.c:1626 msgid "too many weights" msgstr "" -#: time/zic.c:2097 +#: time/zic.c:2109 msgid "too many, or too long, time zone abbreviations" msgstr "" @@ -2678,16 +3368,16 @@ msgstr "" msgid "trailing garbage at end of line" msgstr "" -#: sunrpc/svc_simple.c:132 +#: sunrpc/svc_simple.c:145 #, c-format msgid "trouble replying to prog %d\n" msgstr "" -#: locale/programs/ld-collate.c:1383 +#: locale/programs/ld-collate.c:1386 msgid "two lines in a row containing `...' are not allowed" msgstr "" -#: time/zic.c:1287 +#: time/zic.c:1281 msgid "typed single year" msgstr "" @@ -2702,48 +3392,52 @@ msgstr "" #: locale/programs/ld-messages.c:193 locale/programs/ld-messages.c:204 #: locale/programs/ld-messages.c:215 locale/programs/ld-messages.c:226 -#: locale/programs/ld-time.c:696 +#: locale/programs/ld-time.c:703 #, c-format msgid "unknown character in field `%s' of category `%s'" msgstr "" -#: locale/programs/locfile.c:585 +#: locale/programs/locfile.c:607 msgid "unknown collation directive" msgstr "" -#: catgets/gencat.c:478 +#: catgets/gencat.c:489 #, c-format msgid "unknown directive `%s': line ignored" msgstr "" -#: catgets/gencat.c:457 +#: catgets/gencat.c:468 #, c-format msgid "unknown set `%s'" msgstr "" -#: locale/programs/ld-collate.c:1367 locale/programs/ld-collate.c:1558 -#: locale/programs/ld-collate.c:1732 +#: locale/programs/ld-collate.c:1370 locale/programs/ld-collate.c:1561 +#: locale/programs/ld-collate.c:1735 #, c-format msgid "unknown symbol `%.*s': line ignored" msgstr "" -#: time/zic.c:753 +#: time/zic.c:747 msgid "unruly zone" msgstr "" -#: catgets/gencat.c:962 +#: catgets/gencat.c:973 msgid "unterminated message" msgstr "" -#: locale/programs/linereader.c:515 locale/programs/linereader.c:550 +#: locale/programs/linereader.c:514 locale/programs/linereader.c:549 msgid "unterminated string" msgstr "" -#: locale/programs/linereader.c:385 +#: sunrpc/rpc_scan.c:352 sunrpc/rpc_scan.c:378 +msgid "unterminated string constant" +msgstr "" + +#: locale/programs/linereader.c:384 msgid "unterminated symbolic name" msgstr "" -#: locale/programs/ld-collate.c:1685 +#: locale/programs/ld-collate.c:1688 msgid "unterminated weight name" msgstr "" @@ -2751,7 +3445,7 @@ msgstr "" msgid "upper limit in range is not smaller then lower limit" msgstr "" -#: time/zic.c:2040 +#: time/zic.c:2052 msgid "use of 2/29 in non leap-year" msgstr "" @@ -2765,7 +3459,7 @@ msgstr "" msgid "value for <%s> must lie between 1 and 4" msgstr "" -#: locale/programs/ld-monetary.c:148 locale/programs/ld-numeric.c:89 +#: locale/programs/ld-monetary.c:149 locale/programs/ld-numeric.c:89 #, c-format msgid "value for field `%s' in category `%s' must not be the empty string" msgstr "" @@ -2774,7 +3468,7 @@ msgstr "" msgid "value of must be greater than the value of " msgstr "" -#: locale/programs/ld-monetary.c:138 +#: locale/programs/ld-monetary.c:139 msgid "" "value of field `int_curr_symbol' in category `LC_MONETARY' does not " "correspond to a valid name in ISO 4217" @@ -2785,60 +3479,67 @@ msgid "" "value of field `int_curr_symbol' in category `LC_MONETARY' has wrong length" msgstr "" -#: locale/programs/ld-monetary.c:370 locale/programs/ld-numeric.c:199 +#: locale/programs/ld-monetary.c:373 locale/programs/ld-numeric.c:204 #, c-format msgid "values for field `%s' in category `%s' must be smaller than 127" msgstr "" -#: locale/programs/ld-monetary.c:366 -#, c-format -msgid "values for field `%s' in category `%s' must not be zero" -msgstr "" - #: login/utmp_file.c:84 msgid "while opening UTMP file" msgstr "" -#: catgets/gencat.c:989 +#: catgets/gencat.c:1000 msgid "while opening old catalog file" msgstr "" -#: db/makedb.c:354 +#: locale/programs/locale.c:346 +msgid "while preparing output" +msgstr "" + +#: db/makedb.c:357 msgid "while reading database" msgstr "" -#: db/makedb.c:316 +#: db/makedb.c:319 msgid "while writing data base file" msgstr "" -#: db/makedb.c:142 +#: db/makedb.c:122 msgid "wrong number of arguments" msgstr "" -#: time/zic.c:1081 +#: time/zic.c:1075 msgid "wrong number of fields on Leap line" msgstr "" -#: time/zic.c:1172 +#: time/zic.c:1166 msgid "wrong number of fields on Link line" msgstr "" -#: time/zic.c:915 +#: time/zic.c:909 msgid "wrong number of fields on Rule line" msgstr "" -#: time/zic.c:985 +#: time/zic.c:979 msgid "wrong number of fields on Zone continuation line" msgstr "" -#: time/zic.c:943 +#: time/zic.c:937 msgid "wrong number of fields on Zone line" msgstr "" -#: nis/ypclnt.c:810 +#: sunrpc/xdr_ref.c:79 +msgid "xdr_reference: out of memory\n" +msgstr "" + +#: sunrpc/xdr_rec.c:146 sunrpc/xdr_rec.c:161 +msgid "xdrrec_create: out of memory\n" +msgstr "" + +#: nis/ypclnt.c:813 msgid "yp_update: cannot convert host to netname\n" msgstr "" -#: nis/ypclnt.c:822 +#: nis/ypclnt.c:825 msgid "yp_update: cannot get server address\n" msgstr "" diff --git a/stdio-common/bug5.c b/stdio-common/bug5.c index 59fb6bb9d9..8c3d0e3bc7 100644 --- a/stdio-common/bug5.c +++ b/stdio-common/bug5.c @@ -56,6 +56,10 @@ main (void) puts ("There should be no further output from this test."); fflush (stdout); + /* We must remove this entry to assure the `cmp' binary does not use + the perhaps incompatible new shared libraries. */ + unsetenv ("LD_LIBRARY_PATH"); + asprintf (&printbuf, "cmp %s %s", inname, outname); result = system (printbuf); remove (inname); diff --git a/stdio-common/test-popen.c b/stdio-common/test-popen.c index a17606e503..426da4a24c 100644 --- a/stdio-common/test-popen.c +++ b/stdio-common/test-popen.c @@ -1,9 +1,27 @@ -#include +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include #include void -DEFUN(write_data, (stream), FILE *stream) +write_data (FILE *stream) { int i; for (i=0; i<100; i++) @@ -15,7 +33,7 @@ DEFUN(write_data, (stream), FILE *stream) } void -DEFUN(read_data, (stream), FILE *stream) +read_data (FILE *stream) { int i, j; @@ -32,11 +50,15 @@ DEFUN(read_data, (stream), FILE *stream) } int -DEFUN_VOID(main) +main (void) { FILE *output, *input; int wstatus, rstatus; + /* We must remove this entry to assure the `cat' binary does not use + the perhaps incompatible new shared libraries. */ + unsetenv ("LD_LIBRARY_PATH"); + output = popen ("/bin/cat >/tmp/tstpopen.tmp", "w"); if (output == NULL) { diff --git a/sysdeps/libm-i387/s_cexp.S b/sysdeps/libm-i387/s_cexp.S new file mode 100644 index 0000000000..48e002b2f6 --- /dev/null +++ b/sysdeps/libm-i387/s_cexp.S @@ -0,0 +1,248 @@ +/* ix87 specific implementation of complex exponential function for double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object) +huge_nan_null_null: + .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f + .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f + .double 0.0 + .double 0.0 + .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f + .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f + .double 0.0 + .byte 0, 0, 0, 0, 0, 0, 0, 0x80 + ASM_SIZE_DIRECTIVE(huge_nan_null_null) + + ASM_TYPE_DIRECTIVE(twopi,@object) +twopi: + .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40 + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(twopi) + + ASM_TYPE_DIRECTIVE(l2e,@object) +l2e: + .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(l2e) + + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + + +#ifdef PIC +#define MO(op) op##@GOTOFF(%ecx) +#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) +#else +#define MO(op) op +#define MOX(op,x,f) op(,x,f) +#endif + + .text +ENTRY(__cexp) + fldl 8(%esp) /* x */ + fxam + fnstsw + fldl 16(%esp) /* y : x */ +#ifdef PIC + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx +#endif + movb %ah, %dh + andb $0x45, %ah + cmpb $0x05, %ah + je 1f /* Jump if real part is +-Inf */ + cmpb $0x01, %ah + je 2f /* Jump if real part is NaN */ + + fxam /* y : x */ + fnstsw + /* If the imaginary part is not finite we return NaN+i NaN, as + for the case when the real part is NaN. A test for +-Inf and + NaN would be necessary. But since we know the stack register + we applied `fxam' to is not empty we can simply use one test. + Check your FPU manual for more information. */ + andb $0x01, %ah + cmpb $0x01, %ah + je 2f + + /* We have finite numbers in the real and imaginary part. Do + the real work now. */ + fxch /* x : y */ + fldt MO(l2e) /* log2(e) : x : y */ + fmulp /* x * log2(e) : y */ + fld %st /* x * log2(e) : x * log2(e) : y */ + frndint /* int(x * log2(e)) : x * log2(e) : y */ + fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */ + fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */ + f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */ + faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */ + fscale /* e^x : int(x * log2(e)) : y */ + fst %st(1) /* e^x : e^x : y */ + fxch %st(2) /* y : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 7f + fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */ + fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */ + movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpl 8(%eax) + fstpl (%eax) + ret $4 + + /* We have to reduce the argument to fsincos. */ + .align ALIGNARG(4) +7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */ + fxch /* y : 2*pi : e^x : e^x */ +8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 8b + fstp %st(1) /* y%(2*pi) : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fmulp %st, %st(3) + fmulp %st, %st(1) + movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpl 8(%eax) + fstpl (%eax) + ret $4 + + /* The real part is +-inf. We must make further differences. */ + .align ALIGNARG(4) +1: fxam /* y : x */ + fnstsw + movb %ah, %dl + andb $0x01, %ah /* See above why 0x01 is usable here. */ + cmpb $0x01, %ah + je 3f + + + /* The real part is +-Inf and the imaginary part is finite. */ + andl $0x245, %edx + cmpb $0x40, %dl /* Imaginary part == 0? */ + je 4f /* Yes -> */ + + fxch /* x : y */ + shrl $5, %edx + fstp %st(0) /* y */ /* Drop the real part. */ + andl $16, %edx /* This puts the sign bit of the real part + in bit 4. So we can use it to index a + small array to select 0 or Inf. */ + fsincos /* cos(y) : sin(y) */ + fnstsw + testl $0x0400, %eax + jnz 5f + fldl MOX(huge_nan_null_null,%edx,1) + movl 4(%esp), %edx /* Pointer to memory for result. */ + fstl 8(%edx) + fstpl (%edx) + ftst + fnstsw + shll $23, %eax + andl $0x80000000, %eax + orl %eax, 4(%edx) + fstp %st(0) + ftst + fnstsw + shll $23, %eax + andl $0x80000000, %eax + orl %eax, 12(%edx) + fstp %st(0) + ret $4 + /* We must reduce the argument to fsincos. */ + .align ALIGNARG(4) +5: fldt MO(twopi) + fxch +6: fprem1 + fnstsw + testl $0x400, %eax + jnz 6b + fstp %st(1) + fsincos + fldl MOX(huge_nan_null_null,%edx,1) + movl 4(%esp), %edx /* Pointer to memory for result. */ + fstl 8(%edx) + fstpl (%edx) + ftst + fnstsw + shll $23, %eax + andl $0x80000000, %eax + orl %eax, 4(%edx) + fstp %st(0) + ftst + fnstsw + shll $23, %eax + andl $0x80000000, %eax + orl %eax, 12(%edx) + fstp %st(0) + ret $4 + + /* The real part is +-Inf and the imaginary part is +-0. So return + +-Inf+-0i. */ + .align ALIGNARG(4) +4: movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpl 8(%eax) + shrl $5, %edx + fstp %st(0) + andl $16, %edx + fldl MOX(huge_nan_null_null,%edx,1) + fstpl (%eax) + ret $4 + + /* The real part is +-Inf, the imaginary is also is not finite. */ + .align ALIGNARG(4) +3: fstp %st(0) + fstp %st(0) /* */ + movl %edx, %eax + shrl $5, %edx + shll $4, %eax + andl $16, %edx + andl $32, %eax + orl %eax, %edx + movl 4(%esp), %eax /* Pointer to memory for result. */ + + fldl MOX(huge_nan_null_null,%edx,1) + fldl MOX(huge_nan_null_null+8,%edx,1) + fstpl 8(%eax) + fstpl (%eax) + ret $4 + + /* The real part is NaN. */ + .align ALIGNARG(4) +2: fstp %st(0) + fstp %st(0) + movl 4(%esp), %eax /* Pointer to memory for result. */ + fldl MO(huge_nan_null_null+8) + fstl (%eax) + fstpl 8(%eax) + ret $4 + +END(__cexp) +weak_alias (__cexp, cexp) diff --git a/sysdeps/libm-i387/s_cexpf.S b/sysdeps/libm-i387/s_cexpf.S new file mode 100644 index 0000000000..6fd414b045 --- /dev/null +++ b/sysdeps/libm-i387/s_cexpf.S @@ -0,0 +1,245 @@ +/* ix87 specific implementation of complex exponential function for double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object) +huge_nan_null_null: + .byte 0, 0, 0x80, 0x7f + .byte 0, 0, 0xc0, 0x7f + .float 0.0 + .float 0.0 + .byte 0, 0, 0x80, 0x7f + .byte 0, 0, 0xc0, 0x7f + .float 0.0 + .byte 0, 0, 0, 0x80 + ASM_SIZE_DIRECTIVE(huge_nan_null_null) + + ASM_TYPE_DIRECTIVE(twopi,@object) +twopi: + .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40 + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(twopi) + + ASM_TYPE_DIRECTIVE(l2e,@object) +l2e: + .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(l2e) + + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + + +#ifdef PIC +#define MO(op) op##@GOTOFF(%ecx) +#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) +#else +#define MO(op) op +#define MOX(op,x,f) op(,x,f) +#endif + + .text +ENTRY(__cexpf) + flds 4(%esp) /* x */ + fxam + fnstsw + flds 8(%esp) /* y : x */ +#ifdef PIC + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx +#endif + movb %ah, %dh + andb $0x45, %ah + cmpb $0x05, %ah + je 1f /* Jump if real part is +-Inf */ + cmpb $0x01, %ah + je 2f /* Jump if real part is NaN */ + + fxam /* y : x */ + fnstsw + /* If the imaginary part is not finite we return NaN+i NaN, as + for the case when the real part is NaN. A test for +-Inf and + NaN would be necessary. But since we know the stack register + we applied `fxam' to is not empty we can simply use one test. + Check your FPU manual for more information. */ + andb $0x01, %ah + cmpb $0x01, %ah + je 2f + + /* We have finite numbers in the real and imaginary part. Do + the real work now. */ + fxch /* x : y */ + fldt MO(l2e) /* log2(e) : x : y */ + fmulp /* x * log2(e) : y */ + fld %st /* x * log2(e) : x * log2(e) : y */ + frndint /* int(x * log2(e)) : x * log2(e) : y */ + fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */ + fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */ + f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */ + faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */ + fscale /* e^x : int(x * log2(e)) : y */ + fst %st(1) /* e^x : e^x : y */ + fxch %st(2) /* y : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 7f + fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */ + fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */ + subl $8, %esp + fstps 4(%esp) + fstps (%esp) + popl %eax + popl %edx + ret + + /* We have to reduce the argument to fsincos. */ + .align ALIGNARG(4) +7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */ + fxch /* y : 2*pi : e^x : e^x */ +8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 8b + fstp %st(1) /* y%(2*pi) : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fmulp %st, %st(3) + fmulp %st, %st(1) + subl $8, %esp + fstps 4(%esp) + fstps (%esp) + popl %eax + popl %edx + ret + + /* The real part is +-inf. We must make further differences. */ + .align ALIGNARG(4) +1: fxam /* y : x */ + fnstsw + movb %ah, %dl + andb $0x01, %ah /* See above why 0x01 is usable here. */ + cmpb $0x01, %ah + je 3f + + + /* The real part is +-Inf and the imaginary part is finite. */ + andl $0x245, %edx + cmpb $0x40, %dl /* Imaginary part == 0? */ + je 4f /* Yes -> */ + + fxch /* x : y */ + shrl $6, %edx + fstp %st(0) /* y */ /* Drop the real part. */ + andl $8, %edx /* This puts the sign bit of the real part + in bit 3. So we can use it to index a + small array to select 0 or Inf. */ + fsincos /* cos(y) : sin(y) */ + fnstsw + testl $0x0400, %eax + jnz 5f + fxch + ftst + fnstsw + fstp %st(0) + shll $23, %eax + andl $0x80000000, %eax + orl MOX(huge_nan_null_null,%edx,1), %eax + movl MOX(huge_nan_null_null,%edx,1), %ecx + movl %eax, %edx + ftst + fnstsw + fstp %st(0) + shll $23, %eax + andl $0x80000000, %eax + orl %ecx, %eax + ret + /* We must reduce the argument to fsincos. */ + .align ALIGNARG(4) +5: fldt MO(twopi) + fxch +6: fprem1 + fnstsw + testl $0x400, %eax + jnz 6b + fstp %st(1) + fsincos + fxch + ftst + fnstsw + fstp %st(0) + shll $23, %eax + andl $0x80000000, %eax + orl MOX(huge_nan_null_null,%edx,1), %eax + movl MOX(huge_nan_null_null,%edx,1), %ecx + movl %eax, %edx + ftst + fnstsw + fstp %st(0) + shll $23, %eax + andl $0x80000000, %eax + orl %ecx, %eax + ret + + /* The real part is +-Inf and the imaginary part is +-0. So return + +-Inf+-0i. */ + .align ALIGNARG(4) +4: subl $4, %esp + fstps (%esp) + shrl $6, %edx + fstp %st(0) + andl $8, %edx + movl MOX(huge_nan_null_null,%edx,1), %eax + popl %edx + ret + + /* The real part is +-Inf, the imaginary is also is not finite. */ + .align ALIGNARG(4) +3: fstp %st(0) + fstp %st(0) /* */ + movl %edx, %eax + shrl $6, %edx + shll $3, %eax + andl $8, %edx + andl $16, %eax + orl %eax, %edx + + movl MOX(huge_nan_null_null,%edx,1), %eax + movl MOX(huge_nan_null_null+4,%edx,1), %edx + ret + + /* The real part is NaN. */ + .align ALIGNARG(4) +2: fstp %st(0) + fstp %st(0) + movl MO(huge_nan_null_null+4), %eax + movl %eax, %edx + ret + +END(__cexpf) +weak_alias (__cexpf, cexpf) diff --git a/sysdeps/libm-i387/s_cexpl.S b/sysdeps/libm-i387/s_cexpl.S new file mode 100644 index 0000000000..fa31e74162 --- /dev/null +++ b/sysdeps/libm-i387/s_cexpl.S @@ -0,0 +1,249 @@ +/* ix87 specific implementation of complex exponential function for double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object) +huge_nan_null_null: + .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f + .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f + .double 0.0 + .double 0.0 + .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f + .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f + .double 0.0 + .byte 0, 0, 0, 0, 0, 0, 0, 0x80 + ASM_SIZE_DIRECTIVE(huge_nan_null_null) + + ASM_TYPE_DIRECTIVE(twopi,@object) +twopi: + .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40 + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(twopi) + + ASM_TYPE_DIRECTIVE(l2e,@object) +l2e: + .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f + .byte 0, 0, 0, 0, 0, 0 + ASM_SIZE_DIRECTIVE(l2e) + + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + + +#ifdef PIC +#define MO(op) op##@GOTOFF(%ecx) +#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) +#else +#define MO(op) op +#define MOX(op,x,f) op(,x,f) +#endif + + .text +ENTRY(__cexpl) + fldt 8(%esp) /* x */ + fxam + fnstsw + fldt 20(%esp) /* y : x */ +#ifdef PIC + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx +#endif + movb %ah, %dh + andb $0x45, %ah + cmpb $0x05, %ah + je 1f /* Jump if real part is +-Inf */ + cmpb $0x01, %ah + je 2f /* Jump if real part is NaN */ + + fxam /* y : x */ + fnstsw + /* If the imaginary part is not finite we return NaN+i NaN, as + for the case when the real part is NaN. A test for +-Inf and + NaN would be necessary. But since we know the stack register + we applied `fxam' to is not empty we can simply use one test. + Check your FPU manual for more information. */ + andb $0x01, %ah + cmpb $0x01, %ah + je 2f + + /* We have finite numbers in the real and imaginary part. Do + the real work now. */ + fxch /* x : y */ + fldt MO(l2e) /* log2(e) : x : y */ + fmulp /* x * log2(e) : y */ + fld %st /* x * log2(e) : x * log2(e) : y */ + frndint /* int(x * log2(e)) : x * log2(e) : y */ + fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */ + fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */ + f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */ + faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */ + fscale /* e^x : int(x * log2(e)) : y */ + fst %st(1) /* e^x : e^x : y */ + fxch %st(2) /* y : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 7f + fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */ + fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */ + movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpt 12(%eax) + fstpt (%eax) + ret $4 + + /* We have to reduce the argument to fsincos. */ + .align ALIGNARG(4) +7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */ + fxch /* y : 2*pi : e^x : e^x */ +8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */ + fnstsw + testl $0x400, %eax + jnz 8b + fstp %st(1) /* y%(2*pi) : e^x : e^x */ + fsincos /* cos(y) : sin(y) : e^x : e^x */ + fmulp %st, %st(3) + fmulp %st, %st(1) + movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpt 12(%eax) + fstpt (%eax) + ret $4 + + /* The real part is +-inf. We must make further differences. */ + .align ALIGNARG(4) +1: fxam /* y : x */ + fnstsw + movb %ah, %dl + andb $0x01, %ah /* See above why 0x01 is usable here. */ + cmpb $0x01, %ah + je 3f + + + /* The real part is +-Inf and the imaginary part is finite. */ + andl $0x245, %edx + cmpb $0x40, %dl /* Imaginary part == 0? */ + je 4f /* Yes -> */ + + fxch /* x : y */ + shrl $5, %edx + fstp %st(0) /* y */ /* Drop the real part. */ + andl $16, %edx /* This puts the sign bit of the real part + in bit 4. So we can use it to index a + small array to select 0 or Inf. */ + fsincos /* cos(y) : sin(y) */ + fnstsw + testl $0x0400, %eax + jnz 5f + fldl MOX(huge_nan_null_null,%edx,1) + movl 4(%esp), %edx /* Pointer to memory for result. */ + fstl 8(%edx) + fstpl (%edx) + ftst + fnstsw + shll $7, %eax + andl $0x8000, %eax + orl %eax, 8(%edx) + fstp %st(0) + ftst + fnstsw + shll $7, %eax + andl $0x8000, %eax + orl %eax, 20(%edx) + fstp %st(0) + ret $4 + /* We must reduce the argument to fsincos. */ + .align ALIGNARG(4) +5: fldt MO(twopi) + fxch +6: fprem1 + fnstsw + testl $0x400, %eax + jnz 6b + fstp %st(1) + fsincos + fldl MOX(huge_nan_null_null,%edx,1) + movl 4(%esp), %edx /* Pointer to memory for result. */ + fstl 8(%edx) + fstpl (%edx) + ftst + fnstsw + shll $7, %eax + andl $0x8000, %eax + orl %eax, 8(%edx) + fstp %st(0) + ftst + fnstsw + shll $7, %eax + andl $0x8000, %eax + orl %eax, 20(%edx) + fstp %st(0) + ret $4 + + /* The real part is +-Inf and the imaginary part is +-0. So return + +-Inf+-0i. */ + .align ALIGNARG(4) +4: movl 4(%esp), %eax /* Pointer to memory for result. */ + fstpt 12(%eax) + shrl $5, %edx + fstp %st(0) + andl $16, %edx + fldl MOX(huge_nan_null_null,%edx,1) + fstpt (%eax) + ret $4 + + /* The real part is +-Inf, the imaginary is also is not finite. */ + .align ALIGNARG(4) +3: fstp %st(0) + fstp %st(0) /* */ + movl %edx, %eax + shrl $5, %edx + shll $4, %eax + andl $16, %edx + andl $32, %eax + orl %eax, %edx + movl 4(%esp), %eax /* Pointer to memory for result. */ + + fldl MOX(huge_nan_null_null,%edx,1) + fldl MOX(huge_nan_null_null+8,%edx,1) + fstpt 12(%eax) + fstpt (%eax) + ret $4 + + /* The real part is NaN. */ + .align ALIGNARG(4) +2: fstp %st(0) + fstp %st(0) + movl 4(%esp), %eax /* Pointer to memory for result. */ + fldl MO(huge_nan_null_null+8) + fld %st(0) + fstpt (%eax) + fstpt 12(%eax) + ret $4 + +END(__cexpl) +weak_alias (__cexpl, cexpl) diff --git a/sysdeps/libm-ieee754/s_ccosh.c b/sysdeps/libm-ieee754/s_ccosh.c new file mode 100644 index 0000000000..f01b245e77 --- /dev/null +++ b/sysdeps/libm-ieee754/s_ccosh.c @@ -0,0 +1,95 @@ +/* Complex cosine hyperbole function for double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ double +__ccosh (__complex__ double x) +{ + __complex__ double retval; + + __real__ x = fabs (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + double exp_val = __exp (__real__ x); + double rec_exp_val = 1.0 / exp_val; + + __real__ retval = 0.5 * (exp_val + rec_exp_val) * __cos (__imag__ x); + __imag__ retval = 0.5 * (exp_val + rec_exp_val) * __sin (__imag__ x); + } + else + { + if (__real__ x == 0) + { + __imag__ retval = 0.0; + __real__ retval = __nan ("") + __nan (""); + } + else + { + __real__ retval = __nan (""); + __imag__ retval = __nan ("") + __nan (""); + } + } + } + else if (__isinf (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = HUGE_VAL; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysign (HUGE_VAL, __cos (__imag__ x)); + __imag__ retval = __copysign (HUGE_VAL, __sin (__imag__ x)); + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VAL; + __imag__ retval = __nan ("") + __nan (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nan (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nan (""); + __imag__ retval = __nan (""); + } + } + + return retval; +} +weak_alias (__ccosh, ccosh) +#ifdef NO_LONG_DOUBLE +strong_alias (__ccosh, __ccoshl) +weak_alias (__ccosh, ccoshl) +#endif diff --git a/sysdeps/libm-ieee754/s_ccoshf.c b/sysdeps/libm-ieee754/s_ccoshf.c new file mode 100644 index 0000000000..9f2774b6c7 --- /dev/null +++ b/sysdeps/libm-ieee754/s_ccoshf.c @@ -0,0 +1,93 @@ +/* Complex cosine hyperbole function for float. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ float +__ccoshf (__complex__ float x) +{ + __complex__ float retval; + + __real__ x = fabsf (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + float exp_val = __expf (__real__ x); + float rec_exp_val = 1.0 / exp_val; + + __real__ retval = (0.5 * (exp_val + rec_exp_val) + * __cosf (__imag__ x)); + __imag__ retval = (0.5 * (exp_val + rec_exp_val) + * __sinf (__imag__ x)); + } + else + { + if (__real__ x == 0) + { + __imag__ retval = 0.0; + __real__ retval = __nanf ("") + __nanf (""); + } + else + { + __real__ retval = __nanf (""); + __imag__ retval = __nanf ("") + __nanf (""); + } + } + } + else if (__isinff (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = HUGE_VALF; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysignf (HUGE_VALF, __cosf (__imag__ x)); + __imag__ retval = __copysignf (HUGE_VALF, __sinf (__imag__ x)); + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VALF; + __imag__ retval = __nanf ("") + __nanf (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nanf (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nanf (""); + __imag__ retval = __nanf (""); + } + } + + return retval; +} +weak_alias (__ccoshf, ccoshf) diff --git a/sysdeps/libm-ieee754/s_ccoshl.c b/sysdeps/libm-ieee754/s_ccoshl.c new file mode 100644 index 0000000000..fd553418b4 --- /dev/null +++ b/sysdeps/libm-ieee754/s_ccoshl.c @@ -0,0 +1,93 @@ +/* Complex cosine hyperbole function for long double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ long double +__ccoshl (__complex__ long double x) +{ + __complex__ long double retval; + + __real__ x = fabsl (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + long double exp_val = __expl (__real__ x); + long double rec_exp_val = 1.0 / exp_val; + + __real__ retval = (0.5 * (exp_val + rec_exp_val) + * __cosl (__imag__ x)); + __imag__ retval = (0.5 * (exp_val + rec_exp_val) + * __sinl (__imag__ x)); + } + else + { + if (__real__ x == 0) + { + __imag__ retval = 0.0; + __real__ retval = __nanl ("") + __nanl (""); + } + else + { + __real__ retval = __nanl (""); + __imag__ retval = __nanl ("") + __nanl (""); + } + } + } + else if (__isinfl (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = HUGE_VALL; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysignl (HUGE_VALL, __cosl (__imag__ x)); + __imag__ retval = __copysignl (HUGE_VALL, __sinl (__imag__ x)); + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VALL; + __imag__ retval = __nanl ("") + __nanl (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nanl (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nanl (""); + __imag__ retval = __nanl (""); + } + } + + return retval; +} +weak_alias (__ccoshl, ccoshl) diff --git a/sysdeps/libm-ieee754/s_cexp.c b/sysdeps/libm-ieee754/s_cexp.c index 46f9f612eb..233a40014f 100644 --- a/sysdeps/libm-ieee754/s_cexp.c +++ b/sysdeps/libm-ieee754/s_cexp.c @@ -1,4 +1,4 @@ -/* Return value of complex exponential function for double complex value. +/* Return value of complex exponential function for float complex value. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -31,33 +31,52 @@ __cexp (__complex__ double x) { if (isfinite (__imag__ x)) { - retval = __exp (__real__ x) * (__cos (__imag__ x) - + 1i * __sin (__imag__ x)); + double exp_val = __exp (__real__ x); + + __real__ retval = exp_val * __cos (__imag__ x); + __imag__ retval = exp_val * __sin (__imag__ x); } else - /* If the imaginary part is +-inf or NaN and the real part is - not +-inf the result is NaN + iNan. */ - retval = __nan ("") + 1.0i * __nan (""); + { + /* If the imaginary part is +-inf or NaN and the real part + is not +-inf the result is NaN + iNaN. */ + __real__ retval = __nan (""); + __imag__ retval = __nan (""); + } } else if (__isinf (__real__ x)) { - if (isfinite (__imag x)) + if (isfinite (__imag__ x)) { if (signbit (__real__ x) == 0 && __imag__ x == 0.0) retval = HUGE_VAL; else - retval = ((signbit (__real__ x) ? 0.0 : HUGE_VAL) - * (__cos (__imag__ x) + 1i * __sin (__imag__ x))); + { + double value = signbit (__real__ x) ? 0.0 : HUGE_VAL; + + __real__ retval = value * __cos (__imag__ x); + __imag__ retval = value * __sin (__imag__ x); + } + } + else if (signbit (__real__ x) == 0) + { + __real__ retval = HUGE_VAL; + __imag__ retval = __nan (""); } - else if (signbit (__real__ x)) - retval = HUGE_VAL + 1.0i * __nan (""); else retval = 0.0; } else - /* If the real part is NaN the result is NaN + iNan. */ - retval = __nan ("") + 1.0i * __nan (""); + { + /* If the real part is NaN the result is NaN + iNaN. */ + __real__ retval = __nan (""); + __imag__ retval = __nan (""); + } return retval; } weak_alias (__cexp, cexp) +#ifdef NO_LONG_DOUBLE +string_alias (__cexp, __cexpl) +weak_alias (__cexp, cexpl) +#endif diff --git a/sysdeps/libm-ieee754/s_cexpf.c b/sysdeps/libm-ieee754/s_cexpf.c index 261b18cb3a..c5d8f0cc07 100644 --- a/sysdeps/libm-ieee754/s_cexpf.c +++ b/sysdeps/libm-ieee754/s_cexpf.c @@ -33,8 +33,16 @@ __cexpf (__complex__ float x) { float exp_val = __expf (__real__ x); - __real__ retval = exp_val * __cosf (__imag__ x); - __imag__ retval = exp_val * __sinf (__imag__ x); + if (isfinite (exp_val)) + { + __real__ retval = exp_val * __cosf (__imag__ x); + __imag__ retval = exp_val * __sinf (__imag__ x); + } + else + { + __real__ retval = __copysignf (exp_val, __cosf (__imag__ x)); + __imag__ retval = __copysignf (exp_val, __sinf (__imag__ x)); + } } else { @@ -48,14 +56,17 @@ __cexpf (__complex__ float x) { if (isfinite (__imag__ x)) { - if (signbit (__real__ x) == 0 && __imag__ x == 0.0) - retval = HUGE_VALF; + float value = signbit (__real__ x) ? 0.0 : HUGE_VALF; + + if (__imag__ x == 0.0) + { + __real__ retval = value; + __imag__ retval = __imag__ x; + } else { - float value = signbit (__real__ x) ? 0.0 : HUGE_VALF; - - __real__ retval = value * __cosf (__imag__ x); - __imag__ retval = value * __sinf (__imag__ x); + __real__ retval = __copysignf (value, __cosf (__imag__ x)); + __imag__ retval = __copysignf (value, __sinf (__imag__ x)); } } else if (signbit (__real__ x) == 0) @@ -64,7 +75,10 @@ __cexpf (__complex__ float x) __imag__ retval = __nanf (""); } else - retval = 0.0; + { + __real__ retval = 0.0; + __imag__ retval = __copysignf (0.0, __imag__ x); + } } else { diff --git a/sysdeps/libm-ieee754/s_cexpl.c b/sysdeps/libm-ieee754/s_cexpl.c index 779286f6b3..f1cdf43ec8 100644 --- a/sysdeps/libm-ieee754/s_cexpl.c +++ b/sysdeps/libm-ieee754/s_cexpl.c @@ -33,8 +33,16 @@ __cexpl (__complex__ long double x) { long double exp_val = __expl (__real__ x); - __real__ retval = exp_val * __cosl (__imag__ x); - __imag__ retval = exp_val * __sinl (__imag__ x); + if (isfinite (exp_val)) + { + __real__ retval = exp_val * __cosl (__imag__ x); + __imag__ retval = exp_val * __sinl (__imag__ x); + } + else + { + __real__ retval = __copysignl (exp_val, __cosl (__imag__ x)); + __imag__ retval = __copysignl (exp_val, __sinl (__imag__ x)); + } } else { @@ -48,14 +56,17 @@ __cexpl (__complex__ long double x) { if (isfinite (__imag__ x)) { - if (signbit (__real__ x) == 0 && __imag__ x == 0.0) - retval = HUGE_VAL; + long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL; + + if (__imag__ x == 0.0) + { + __real__ retval = value; + __imag__ retval = __imag__ x; + } else { - long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL; - - __real__ retval = value * __cosl (__imag__ x); - __imag__ retval = value * __sinl (__imag__ x); + __real__ retval = __copysignl (value, __cosl (__imag__ x)); + __imag__ retval = __copysignl (value, __sinl (__imag__ x)); } } else if (signbit (__real__ x) == 0) @@ -64,7 +75,10 @@ __cexpl (__complex__ long double x) __imag__ retval = __nanl (""); } else - retval = 0.0; + { + __real__ retval = 0.0; + __imag__ retval = __copysignl (0.0, __imag__ x); + } } else { diff --git a/sysdeps/libm-ieee754/s_csinh.c b/sysdeps/libm-ieee754/s_csinh.c new file mode 100644 index 0000000000..aab041bdf9 --- /dev/null +++ b/sysdeps/libm-ieee754/s_csinh.c @@ -0,0 +1,102 @@ +/* Complex sine hyperbole function for double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ double +__csinh (__complex__ double x) +{ + __complex__ double retval; + int negate = signbit (__real__ x); + + __real__ x = fabs (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + double exp_val = __exp (__real__ x); + double rec_exp_val = 1.0 / exp_val; + + __real__ retval = 0.5 * (exp_val - rec_exp_val) * __cos (__imag__ x); + __imag__ retval = 0.5 * (exp_val - rec_exp_val) * __sin (__imag__ x); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + if (__real__ x == 0) + { + __real__ retval = __copysign (0.0, negate ? -1.0 : 1.0); + __imag__ retval = __nan ("") + __nan (""); + } + else + { + __real__ retval = __nan (""); + __imag__ retval = __nan (""); + } + } + } + else if (__isinf (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = negate ? -HUGE_VAL : HUGE_VAL; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysign (HUGE_VAL, __cos (__imag__ x)); + __imag__ retval = __copysign (HUGE_VAL, __sin (__imag__ x)); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VAL; + __imag__ retval = __nan ("") + __nan (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nan (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nan (""); + __imag__ retval = __nan (""); + } + } + + return retval; +} +weak_alias (__csinh, csinh) +#ifdef NO_LONG_DOUBLE +strong_alias (__csinh, __csinhl) +weak_alias (__csinh, csinhl) +#endif diff --git a/sysdeps/libm-ieee754/s_csinhf.c b/sysdeps/libm-ieee754/s_csinhf.c new file mode 100644 index 0000000000..204bbfebb9 --- /dev/null +++ b/sysdeps/libm-ieee754/s_csinhf.c @@ -0,0 +1,100 @@ +/* Complex sine hyperbole function for float. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ float +__csinhf (__complex__ float x) +{ + __complex__ float retval; + int negate = signbit (__real__ x); + + __real__ x = fabsf (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + float exp_val = __expf (__real__ x); + float rec_exp_val = 1.0 / exp_val; + + __real__ retval = (0.5 * (exp_val - rec_exp_val) + * __cosf (__imag__ x)); + __imag__ retval = (0.5 * (exp_val - rec_exp_val) + * __sinf (__imag__ x)); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + if (__real__ x == 0) + { + __real__ retval = __copysignf (0.0, negate ? -1.0 : 1.0); + __imag__ retval = __nanf ("") + __nanf (""); + } + else + { + __real__ retval = __nanf (""); + __imag__ retval = __nanf (""); + } + } + } + else if (__isinff (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = negate ? -HUGE_VALF : HUGE_VALF; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysignf (HUGE_VALF, __cosf (__imag__ x)); + __imag__ retval = __copysignf (HUGE_VALF, __sinf (__imag__ x)); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VALF; + __imag__ retval = __nanf ("") + __nanf (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nanf (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nanf (""); + __imag__ retval = __nanf (""); + } + } + + return retval; +} +weak_alias (__csinhf, csinhf) diff --git a/sysdeps/libm-ieee754/s_csinhl.c b/sysdeps/libm-ieee754/s_csinhl.c new file mode 100644 index 0000000000..e403dd4796 --- /dev/null +++ b/sysdeps/libm-ieee754/s_csinhl.c @@ -0,0 +1,100 @@ +/* Complex sine hyperbole function for long double. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + + +__complex__ long double +__csinhl (__complex__ long double x) +{ + __complex__ long double retval; + int negate = signbit (__real__ x); + + __real__ x = fabs (__real__ x); + + if (isfinite (__real__ x)) + { + if (isfinite (__imag__ x)) + { + long double exp_val = __expl (__real__ x); + long double rec_exp_val = 1.0 / exp_val; + + __real__ retval = (0.5 * (exp_val - rec_exp_val) + * __cosl (__imag__ x)); + __imag__ retval = (0.5 * (exp_val - rec_exp_val) + * __sinl (__imag__ x)); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + if (__real__ x == 0) + { + __real__ retval = __copysignl (0.0, negate ? -1.0 : 1.0); + __imag__ retval = __nanl ("") + __nanl (""); + } + else + { + __real__ retval = __nanl (""); + __imag__ retval = __nanl (""); + } + } + } + else if (__isinfl (__real__ x)) + { + if (__imag__ x == 0.0) + { + __real__ retval = negate ? -HUGE_VALL : HUGE_VALL; + __imag__ retval = __imag__ x; + } + else if (isfinite (__imag__ x)) + { + __real__ retval = __copysignl (HUGE_VALL, __cosl (__imag__ x)); + __imag__ retval = __copysignl (HUGE_VALL, __sinl (__imag__ x)); + + if (negate) + __real__ retval = -__real__ retval; + } + else + { + /* The addition raises the invalid exception. */ + __real__ retval = HUGE_VALL; + __imag__ retval = __nanl ("") + __nanl (""); + } + } + else + { + if (__imag__ x == 0.0) + { + __real__ retval = __nanl (""); + __imag__ retval = __imag__ x; + } + else + { + __real__ retval = __nanl (""); + __imag__ retval = __nanl (""); + } + } + + return retval; +} +weak_alias (__csinhl, csinhl) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 4d32ee02ac..f819bb4c0c 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -45,7 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* getaddrinfo() v1.13 */ /* To do what POSIX says, even when it's broken: */ -/* #define BROKEN_LIKE_POSIX 1 */ +#define BROKEN_LIKE_POSIX 1 #define LOCAL 1 #define INET6 1 #define HOSTTABLE 0 @@ -168,21 +168,34 @@ static int gaih_local(const char *name, const struct gaih_service *service, }; #endif /* LOCAL */ -static struct gaih_typeproto gaih_inet_typeproto[] = { +static struct gaih_typeproto gaih_inet_typeproto[] = +{ { 0, 0, NULL }, - { SOCK_STREAM, IPPROTO_TCP, (char *)"tcp" }, - { SOCK_DGRAM, IPPROTO_UDP, (char *)"udp" }, + { SOCK_STREAM, IPPROTO_TCP, (char *) "tcp" }, + { SOCK_DGRAM, IPPROTO_UDP, (char *) "udp" }, { 0, 0, NULL } }; static int gaih_inet_serv(char *servicename, struct gaih_typeproto *tp, struct gaih_servtuple **st) { struct servent *s; + int tmpbuflen = 1024; + struct servent ts; + char *tmpbuf = __alloca (tmpbuflen); + while (__getservbyname_r (servicename, tp->name, &ts, tmpbuf, tmpbuflen, &s)) + { + if (errno == ERANGE) + { + tmpbuflen *= 2; + tmpbuf = __alloca (tmpbuflen); + } + else + { + return GAIH_OKIFUNSPEC | -EAI_SERVICE; + } + } - if (!(s = getservbyname(servicename, tp->name))) - return (GAIH_OKIFUNSPEC | -EAI_SERVICE); - - if (!(*st = malloc(sizeof(struct gaih_servtuple)))) + if (!(*st = malloc (sizeof (struct gaih_servtuple)))) return -EAI_MEMORY; (*st)->next = NULL; diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c index b1a685c29a..2b8f9cb590 100644 --- a/sysdeps/posix/system.c +++ b/sysdeps/posix/system.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +/* Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/sparc/dl-machine.h b/sysdeps/sparc/dl-machine.h index cadf353878..ceaf9eedce 100644 --- a/sysdeps/sparc/dl-machine.h +++ b/sysdeps/sparc/dl-machine.h @@ -105,7 +105,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, Elf32_Addr loadbase; if (ELF32_R_TYPE (reloc->r_info) == R_SPARC_RELATIVE) - *reloc_addr += map->l_addr + reloc->r_addend; + { +#ifndef RTLD_BOOTSTRAP + if (map != &_dl_rtld_map) /* Already done in rtld itself. */ +#endif + *reloc_addr += map->l_addr + reloc->r_addend; + } else { Elf32_Addr value; diff --git a/sysdeps/sparc/udiv_qrnnd.S b/sysdeps/sparc/udiv_qrnnd.S index 4cd4f051b3..e5d30679e1 100644 --- a/sysdeps/sparc/udiv_qrnnd.S +++ b/sysdeps/sparc/udiv_qrnnd.S @@ -1,6 +1,6 @@ ! SPARC __udiv_qrnnd division support, used from longlong.h. -! Copyright (C) 1993, 1994 Free Software Foundation, Inc. +! Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc. ! This file is part of the GNU MP Library. @@ -18,6 +18,8 @@ ! along with the GNU MP Library; see the file COPYING.LIB. If not, write to ! the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +! +! Added PIC support - May/96, Miguel de Icaza ! INPUT PARAMETERS ! rem_ptr i0 @@ -25,6 +27,7 @@ ! n0 i2 ! d i3 +#include "DEFS.h" #include "sysdep.h" #undef ret /* Kludge for glibc */ @@ -34,16 +37,25 @@ LC0: .double 0r4294967296 LC1: .double 0r2147483648 .align 4 - .global C_SYMBOL_NAME(__udiv_qrnnd) -C_SYMBOL_NAME(__udiv_qrnnd): + .global __udiv_qrnnd +FUNC(__udiv_qrnnd) !#PROLOGUE# 0 save %sp,-104,%sp !#PROLOGUE# 1 st %i1,[%fp-8] ld [%fp-8],%f10 +#ifdef __PIC__ +._XL11: + call ._XL1 + fitod %f10,%f4 +._XL1: + sub %o7,(._XL11-LC0),%o7 + ldd [%o7],%f8 +#else sethi %hi(LC0),%o7 fitod %f10,%f4 ldd [%o7+%lo(LC0)],%f8 +#endif cmp %i1,0 bge L248 mov %i0,%i5 @@ -66,8 +78,17 @@ L249: faddd %f4,%f8,%f4 L250: fdivd %f2,%f4,%f2 +#ifdef __PIC__ +._XL22: + call ._XL2 + nop +._XL2: + sub %o7,(._XL22-LC1),%o7 + ldd [%o7],%f4 +#else sethi %hi(LC1),%o7 ldd [%o7+%lo(LC1)],%f4 +#endif fcmped %f2,%f4 nop fbge,a L251 diff --git a/sysdeps/unix/sysv/linux/sparc/Dist b/sysdeps/unix/sysv/linux/sparc/Dist index b50a46fb68..ab22392c04 100644 --- a/sysdeps/unix/sysv/linux/sparc/Dist +++ b/sysdeps/unix/sysv/linux/sparc/Dist @@ -3,3 +3,5 @@ clone.S start.c pipe.S fork.S +kernel_stat.h +kernel_sigaction.h diff --git a/sysdeps/unix/sysv/linux/sparc/fcntlbits.h b/sysdeps/unix/sysv/linux/sparc/fcntlbits.h new file mode 100644 index 0000000000..3fc7240a66 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/fcntlbits.h @@ -0,0 +1,96 @@ +/* O_*, F_*, FD_* bit values for Linux/SPARC. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTLBITS_H +#define _FCNTLBITS_H 1 + +#include + +/* In GNU, read and write are bits (unlike BSD). */ +#ifdef __USE_GNU +#define O_READ O_RDONLY /* Open for reading. */ +#define O_WRITE O_WRONLY /* Open for writing. */ +#endif + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_RDONLY 0x0000 +#define O_WRONLY 0x0001 +#define O_RDWR 0x0002 +#define O_ACCMODE 0x0003 +#define O_APPEND 0x0008 +#define O_CREAT 0x0200 /* not fcntl */ +#define O_TRUNC 0x0400 /* not fcntl */ +#define O_EXCL 0x0800 /* not fcntl */ +#define O_SYNC 0x2000 +#define O_NONBLOCK 0x4000 +#define O_NDELAY (0x0004 | O_NONBLOCK) +#define O_NOCTTY 0x8000 /* not fcntl */ + +#define F_DUPFD 0 /* dup */ +#define F_GETFD 1 /* get f_flags */ +#define F_SETFD 2 /* set f_flags */ +#define F_GETFL 3 /* more flags (cloexec) */ +#define F_SETFL 4 +#define F_GETOWN 5 /* for sockets. */ +#define F_SETOWN 6 /* for sockets. */ +#define F_GETLK 7 +#define F_SETLK 8 +#define F_SETLKW 9 + +/* for F_[GET|SET]FL */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* for posix fcntl() and lockf() */ +#define F_RDLCK 1 +#define F_WRLCK 2 +#define F_UNLCK 3 + +/* for old implementation of bsd flock () */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +/* operations for bsd flock(), also used by the kernel implementation */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +#define LOCK_UN 8 /* remove lock */ + +struct flock + { + short int l_type; + short int l_whence; + __off_t l_start; + __off_t l_len; + __pid_t l_pid; + short int __unused; + }; + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FASYNC O_ASYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/ioctls.h b/sysdeps/unix/sysv/linux/sparc/ioctls.h new file mode 100644 index 0000000000..80b2e62e77 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/ioctls.h @@ -0,0 +1,39 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _IOCTLS_H +#define _IOCTLS_H 1 + +/* Use the definitions from the kernel header files. */ +#include +#include + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('t', 19, struct __kernel_termios) +#define TCSETS _IOW ('t', 20, struct __kernel_termios) +#define TCSETSW _IOW ('t', 21, struct __kernel_termios) +#define TCSETSF _IOW ('t', 22, struct __kernel_termios) + +#include + +#endif /* ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h new file mode 100644 index 0000000000..f870d15082 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h @@ -0,0 +1,12 @@ +/* Linux/SPARC version. This is the sigaction struction from the Linux + 2.1.20 kernel. */ + +struct sigaction + { + __sighandler_t sa_handler; + sigset_t sa_mask; + unsigned long int sa_flags; + void (*sa_restorer) (void); /* not used by Linux/SPARC yet */ + }; + +#define HAVE_SA_RESTORER diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/kernel_stat.h new file mode 100644 index 0000000000..993a8664dc --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/kernel_stat.h @@ -0,0 +1,21 @@ +/* Definition of `struct stat' used in the kernel */ +struct kernel_stat + { + unsigned short int st_dev; + unsigned long int st_ino; + unsigned short int st_mode; + short int st_nlink; + unsigned short int st_uid; + unsigned short int st_gid; + unsigned short int st_rdev; + long int st_size; + long int st_atime; + unsigned long int __unused1; + long int st_mtime; + unsigned long int __unused2; + long int st_ctime; + unsigned long int __unused3; + long int st_blksize; + long int st_blocks; + unsigned long int __unused4[2]; + }; diff --git a/sysdeps/unix/sysv/linux/sparc/sigaction.h b/sysdeps/unix/sysv/linux/sparc/sigaction.h new file mode 100644 index 0000000000..19aa7e39cb --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sigaction.h @@ -0,0 +1,52 @@ +/* The proper definitions for Linux/SPARC sigaction. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + unsigned int sa_flags; + }; + + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ +#ifdef __USE_MISC +#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ +#define SA_INTERRUPT 0x00000010 /* Historical no-op. */ +#define SA_NOMASK 0x00000020 /* Don't automatically block the signal when + its handler is being executed. */ +#define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */ + +/* Some aliases for the SA_ constants. */ +#define SA_NODEFER SA_NOMASK +#define SA_RESETHAND SA_ONESHOT +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 4 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sparc/signum.h b/sysdeps/unix/sysv/linux/sparc/signum.h new file mode 100644 index 0000000000..d50a636bc3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/signum.h @@ -0,0 +1,72 @@ +/* Signal number definitions. Linux/SPARC version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +/* + * Linux/SPARC has different signal numbers that Linux/i386: I'm trying + * to make it OSF/1 binary compatible, at least for normal binaries. + */ +#define _NSIG 32 /* Biggest signal number + 1. */ +#define NSIG _NSIG + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT 6 +#define SIGEMT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGURG 16 + +/* SunOS values which deviate from the Linux/i386 ones */ +#define SIGSTOP 17 +#define SIGTSTP 18 +#define SIGCONT 19 +#define SIGCHLD 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGIO 23 +#define SIGPOLL SIGIO /* SysV name for SIGIO */ +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGLOST 29 +#define SIGUSR1 30 +#define SIGUSR2 31 + +/* Linux/SPARC does not have SIGPWR */ +#define SIGIOT SIGABRT +#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/sparc/termbits.h b/sysdeps/unix/sysv/linux/sparc/termbits.h new file mode 100644 index 0000000000..bf7aa1480f --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/termbits.h @@ -0,0 +1,217 @@ +/* termios type and macro definitions. Linux/SPARC version. + Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SPARC_TERMBITS_H +#define _SPARC_TERMBITS_H 1 + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned long tcflag_t; + +#define NCCS 17 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ +#ifdef __KERNEL__ +#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) + cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ +#endif + }; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VEOL 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 + + + +#define VSUSP 10 +#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 + +/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is + * shared with eof/eol + */ +#ifdef __KERNEL__ +#define VMIN 16 +#define VTIME 17 +#else +#define VMIN VEOF +#define VTIME VEOL +#endif + +/* c_iflag bits */ +#define IGNBRK 0x00000001 +#define BRKINT 0x00000002 +#define IGNPAR 0x00000004 +#define PARMRK 0x00000008 +#define INPCK 0x00000010 +#define ISTRIP 0x00000020 +#define INLCR 0x00000040 +#define IGNCR 0x00000080 +#define ICRNL 0x00000100 +#define IUCLC 0x00000200 +#define IXON 0x00000400 +#define IXANY 0x00000800 +#define IXOFF 0x00001000 +#define IMAXBEL 0x00002000 + +/* c_oflag bits */ +#define OPOST 0x00000001 +#define OLCUC 0x00000002 +#define ONLCR 0x00000004 +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#define NLDLY 0x00000100 +#define NL0 0x00000000 +#define NL1 0x00000100 +#define CRDLY 0x00000600 +#define CR0 0x00000000 +#define CR1 0x00000200 +#define CR2 0x00000400 +#define CR3 0x00000600 +#define TABDLY 0x00001800 +#define TAB0 0x00000000 +#define TAB1 0x00000800 +#define TAB2 0x00001000 +#define TAB3 0x00001800 +#define XTABS 0x00001800 +#define BSDLY 0x00002000 +#define BS0 0x00000000 +#define BS1 0x00002000 +#define VTDLY 0x00004000 +#define VT0 0x00000000 +#define VT1 0x00004000 +#define FFDLY 0x00008000 +#define FF0 0x00000000 +#define FF1 0x00008000 +#define PAGEOUT 0x00010000 /* SUNOS specific */ +#define WRAP 0x00020000 /* SUNOS specific */ + +/* c_cflag bit meaning */ +#define CBAUD 0x0000000f +#define B0 0x00000000 /* hang up */ +#define B50 0x00000001 +#define B75 0x00000002 +#define B110 0x00000003 +#define B134 0x00000004 +#define B150 0x00000005 +#define B200 0x00000006 +#define B300 0x00000007 +#define B600 0x00000008 +#define B1200 0x00000009 +#define B1800 0x0000000a +#define B2400 0x0000000b +#define B4800 0x0000000c +#define B9600 0x0000000d +#define B19200 0x0000000e +#define B38400 0x0000000f +#define EXTA B19200 +#define EXTB B38400 +#define CSIZE 0x00000030 +#define CS5 0x00000000 +#define CS6 0x00000010 +#define CS7 0x00000020 +#define CS8 0x00000030 +#define CSTOPB 0x00000040 +#define CREAD 0x00000080 +#define PARENB 0x00000100 +#define PARODD 0x00000200 +#define HUPCL 0x00000400 +#define CLOCAL 0x00000800 +/* We'll never see these speeds with the Zilogs' but for completeness... */ +#define CBAUDEX 0x00010000 +#define B57600 0x00010001 +#define B115200 0x00010002 +#define B230400 0x00010003 +#define B460800 0x00010004 +#define CIBAUD 0x000f0000 /* input baud rate (not used) */ +#define CMSPAR 010000000000 /* mark or space (stick) parity */ +#define CRTSCTS 0x80000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0x00000001 +#define ICANON 0x00000002 +#define XCASE 0x00000004 +#define ECHO 0x00000008 +#define ECHOE 0x00000010 +#define ECHOK 0x00000020 +#define ECHONL 0x00000040 +#define NOFLSH 0x00000080 +#define TOSTOP 0x00000100 +#define ECHOCTL 0x00000200 +#define ECHOPRT 0x00000400 +#define ECHOKE 0x00000800 +#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ +#define FLUSHO 0x00002000 +#define PENDIN 0x00004000 +#define IEXTEN 0x00008000 + +/* modem lines */ +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + + +/* tcflow() and TCXONC use these */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* tcflush() and TCFLSH use these */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* tcsetattr uses these */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#endif /* !(_SPARC_TERMBITS_H) */ -- cgit v1.2.3