www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/12/06:53:13

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Sat, 12 Jan 2002 11:54:27 +0000
From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
Sender: rich AT phekda DOT freeserve DOT co DOT uk
To: djgpp-workers AT delorie DOT com
X-Mailer: Emacs 21.0.98 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
Subject: Update for tests/libclink for new ANSI & POSIX stds, revision 2
Message-Id: <E16PMie-0000JA-00@phekda.freeserve.co.uk>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Please find an updated version of the patch to tests/libclink/check.cc
to add the latest functions from the new ANSI and POSIX standards.
The changes from the previous version are:

* Both lists are now sorted alphabetically. I've included the script
  sortfns.pl that I used to check the sorting.

* Fixed mistyping of: erf, wscstat.

* Moved j0, j1, jn, memccpy, wcswidth, wcwidth to the POSIX section.

* Removed signum.

I've left tzname in the ANSI section, despite the fact it's not ANSI.
This is because of the comment at the start of ansi_fns:

    /* Note: tzname is POSIX, but we list it here because it is a datum,
       not a function, and we can't stub it.  ctime() sets tzname, and
       ctime is ANSI and tzname is POSIX.  Sigh. */

If there are no further comments, I'll comment this patch next Saturday,
UK time (GMT).

Thanks, bye, Rich

---Start sortfns.pl---
#! perl
#
# sortfns.pl
# Written by Richard Dawe <richdawe AT bigfoot DOT com>
#
# Check that symbols in ansi_fns and posix_fns arrays in check.cc
# are sorted alphanumerically.
#

use strict;
no strict 'vars';
use FileHandle;

$file = '';

$fh = new FileHandle('<check.cc');
if (!defined($fh)) { die "Unable to open file"; }

while ($line = $fh->getline()) {
    chomp($line);
    $file .= $line;
}

$fh->close();

@ansi_fns  = &sort_fns("ansi_fns", $file);
@posix_fns = &sort_fns("posix_fns", $file);

print "Sorted ANSI functions:\n".join(", ", @ansi_fns)."\n\n";
print "Sorted POSIX functions:\n".join(", ", @posix_fns)."\n\n";

sub sort_fns
{
    my ($array_name, $file) = @_;
    my ($fns_def, @fns, @fns_sorted);

    $fns_def = $file;
    $fns_def =~ s/^.+char\s+\*$array_name\[\]\s+=\s+\{([^\}]+)\};.+$/$1/;
    $fns_def =~ s/[\s\"]//g;

    @fns        = split(/,/, $fns_def);
    @fns_sorted = sort(@fns);

    return(@fns_sorted);
}
---End sortfns.pl---

Index: tests/libclink/check.cc
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libclink/check.cc,v
retrieving revision 1.5
diff -p -u -3 -r1.5 check.cc
--- tests/libclink/check.cc	2001/12/02 10:21:45	1.5
+++ tests/libclink/check.cc	2002/01/12 11:46:00
@@ -20,50 +20,172 @@ char *predefs[] = { "main", "edata", "en
    not a function, and we can't stub it.  ctime() sets tzname, and
    ctime is ANSI and tzname is POSIX.  Sigh. */
 
-char *ansi_fns[] = { "abort", "abs", "acos", "asctime", "asin",
-"atan", "atan2", "atexit", "atof", "atoi", "atol", "bsearch",
-"calloc", "ceil", "clearerr", "clock", "cos", "cosh", "ctime",
-"difftime", "div", "errno", "exit", "exp", "fabs", "fclose", "feof",
-"ferror", "fflush", "fgetc", "fgetpos", "fgets", "floor", "fmod",
-"fopen", "fprintf", "fputc", "fputs", "fread", "free", "freopen",
-"frexp", "fscanf", "fseek", "fsetpos", "ftell", "fwrite", "getc",
-"getchar", "getenv", "gets", "gmtime", "isalnum", "isalpha",
-"iscntrl", "isdigit", "isgraph", "islower", "isprint", "ispunct",
-"isspace", "isupper", "isxdigit", "labs", "ldexp", "ldiv",
-"localeconv", "localtime", "log", "log10", "longjmp", "main",
-"malloc", "mblen", "mbstowcs", "mbtowc", "memchr", "memcmp", "memcpy",
-"memmove", "memset", "mktime", "modf", "perror", "pow", "printf",
-"putc", "putchar", "puts", "qsort", "raise", "rand", "realloc",
-"remove", "rename", "rewind", "scanf", "setbuf", "setjmp",
-"setlocale", "setvbuf", "signal", "sin", "sinh", "snprintf", "sprintf", "sqrt",
+char *ansi_fns[] = { "_Exit", "abort", "abs",
+"acos", "acosf", "acosh", "acoshf", "acoshl", "acosl",
+"asctime", "asin", "asinf", "asinh", "asinhf", "asinhl", "asinl",
+"atan", "atan2", "atan2f", "atan2l",
+"atanf", "atanh", "atanhf", "atanhl", "atanl",
+"atexit", "atof", "atoi", "atol", "atoll", "bsearch", "btowc",
+"cabs", "cabsf", "cabsl",
+"cacos", "cacosf", "cacosh", "cacoshf", "cacoshl", "cacosl",
+"calloc", "carg", "cargf", "cargl",
+"casin", "casinf", "casinh", "casinhf", "casinhl", "casinl",
+"catan", "catanf", "catanh", "catanhf", "catanhl", "catanl",
+"cbrt", "cbrtf", "cbrtl",
+"ccos", "ccosf", "ccosh", "ccoshf", "ccoshl", "ccosl",
+"ceil", "ceilf", "ceill", "cexp", "cexpf", "cexpl",
+"cimag", "cimagf", "cimagl", "clearerr", "clock",
+"clog", "clogf", "clogl", "conj", "conjf", "conjl",
+"copysign", "copysignf", "copysignl", "cos", "cosf",
+"cosh", "coshf", "coshl", "cosl", "cpow", "cpowf", "cpowl",
+"cproj", "cprojf", "cprojl", "creal", "crealf", "creall",
+"csin", "csinf", "csinh", "csinhf", "csinhl", "csinl",
+"csqrt", "csqrtf", "csqrtl",
+"ctan", "ctanf", "ctanh", "ctanhf", "ctanhl", "ctanl",
+"ctime", "difftime", "div",
+"erf", "erff", "erfl", "erfc", "erfcf", "erfcl", "errno", "exit",
+"exp", "exp2", "exp2f", "exp2l", "expf", "expl", 
+"expm1", "expm1f", "expm1l", "fabs", "fabsf", "fabsl", "fclose",
+"fdim", "fdimf", "fdiml", "feclearexcept", "fegetenv", "fegetexceptflag",
+"fegetround", "feholdexcept", "feof", "feraiseexcept", "ferror",
+"fesetenv", "fesetexceptflag", "fesetround", "fetestexcept",
+"feupdateenv", "fflush", "fgetc", "fgetpos", "fgets", "fgetwc", "fgetws",
+"floor", "floorf", "floorl", "fma", "fmaf", "fmal",
+"fmax", "fmaxf", "fmaxl", "fmin", "fminf", "fminl",
+"fmod", "fmodf", "fmodl", "fopen", "fpclassify", "fprintf",
+"fputc", "fputs", "fputwc", "fputws", "fread", "free", "freopen",
+"frexp", "frexpf", "frexpl", "fscanf", "fseek", "fsetpos", "ftell",
+"fwide", "fwprintf", "fwrite", "fwscanf", "getc",
+"getchar", "getenv", "gets", "getwc", "getwchar", "gmtime",
+"hypot", "hypotf", "hypotl", "ilogb", "ilogbf", "ilogbl",
+"imaxabs", "imaxdiv", "isalnum", "isalpha", "isblank",
+"iscntrl", "isdigit", "isfinite", "isgraph", "isgreater",
+"isgreaterequal", "isinf", "isless", "islessequal", "islessgreater",
+"islower", "isnan", "isnormal", "isprint", "ispunct",
+"isspace", "isunordered", "isupper", "iswalnum", "iswalpha", "iswblank",
+"iswcntrl", "iswctype", "iswdigit", "iswgraph", "iswlower", "iswprint",
+"iswpunct", "iswspace", "iswupper", "iswxdigit", "isxdigit",
+"labs", "ldexp", "ldexpf", "ldexpl", "ldiv",
+"lgamma", "lgammaf", "lgammal", "llabs", "lldiv",
+"llrint", "llrintf", "llrintl", "llround", "llroundf", "llroundl",
+"localeconv", "localtime",
+"log", "log10", "log10f", "log10l", "log1p", "log1pf", "log1pl",
+"log2", "log2f", "log2l", "logb", "logbf", "logbl", "logf", "logl",
+"longjmp", "lrint", "lrintf", "lrintl", "lround", "lroundf", "lroundl",
+"main", "malloc", "mblen", "mbrlen", "mbrtowc", "mbsinit",
+"mbsrtowcs", "mbstowcs", "mbtowc", "memchr", "memcmp",
+"memcpy", "memmove", "memset", "mktime",
+"modf", "modff", "modfl", "nan", "nanf", "nanl",
+"nearbyint", "nearbyintf", "nearbyintl",
+"nextafter", "nextafterf", "nextafterl",
+"nexttoward", "nexttowardf", "nexttowardl",
+"perror", "pow", "powf", "powl", "printf", "putc", "putchar", "puts",
+"putwc", "putwchar", "qsort", "raise", "rand", "realloc",
+"remainder", "remainderf", "remainderl",
+"remove", "remquo", "remquof", "remquol", "rename", "rewind",
+"rint", "rintf", "rintl", "round", "roundf", "roundl",
+"scalbln", "scalblnf", "scalblnl", "scalbn", "scalbnf", "scalbnl",
+"scanf", "setbuf", "setjmp", "setlocale", "setvbuf",
+"signal", "signbit", "sin", "sinf", "sinh", "sinhf", "sinhl", "sinl",
+"snprintf", "sprintf", "sqrt", "sqrtf", "sqrtl",
 "srand", "sscanf", "strcat", "strchr", "strcmp", "strcoll", "strcpy",
 "strcspn", "strerror", "strftime", "strlen", "strncat", "strncmp",
-"strncpy", "strpbrk", "strrchr", "strspn", "strstr", "strtod",
-"strtok", "strtol", "strtoul", "strxfrm", "system", "tan", "tanh",
-"time", "tmpfile", "tmpnam", "tolower", "toupper", "tzname", "ungetc",
-"vfprintf", "vprintf", "vsnprintf", "vsprintf", "wcstombs", "wctomb", 0
+"strncpy", "strpbrk", "strrchr", "strspn", "strstr",
+"strtod", "strtof", "strtoimax", "strtok",
+"strtol", "strtold", "strtoll", "strtoul", "strtoull",
+"strtoumax", "strxfrm", "swprinf", "swscanf", "system",
+"tan", "tanf", "tanh", "tanhf", "tanhl", "tanl",
+"tgamma", "tgammaf", "tgammal", "time", "tmpfile", "tmpnam",
+"tolower", "toupper", "towctrans", "towlower", "towupper",
+"trunc", "truncf", "truncl", "tzname", "ungetc", "ungetwc",
+"vfprintf", "vfscanf", "vfwprintf", "vfwscanf", "vprintf",
+"vscanf", "vsnprintf", "vsprintf", "vsscanf", "vswprintf", "vswscanf",
+"vwprintf", "vwscanf", "wcrtomb",
+"wcscat", "wcschr", "wcscmp", "wcscoll", "wcscpy", "wcscspn", "wcsftime",
+"wcslen", "wcsncat", "wcsncmp", "wcsncpy", "wcspbrk", "wcsrchr",
+"wcsrtombs", "wcsspn", "wcsstr", "wcstod", "wcstof",
+"wcstoimax", "wcstok", "wcstol", "wcstold", "wcstoll",
+"wcstombs", "wcstoul", "wcstoull", "wcstoumax",
+"wcsxfrm", "wctob", "wctomb", "wctrans",
+"wctype", "wmemchr", "wmemcmp", "wmemcpy",
+"wmemmove", "wmemset", "wprintf", "wscanf", 0
 };
 
-char *posix_fns[] = { "_exit", "access", "alarm", "cfgetispeed",
-"cfgetospeed", "cfsetispeed", "cfsetospeed", "chdir", "chmod",
-"chown", "close", "closedir", "confstr", "creat", "ctermid", "dup",
-"dup2", "execl", "execle", "execlp", "execv", "execve", "execvp",
-"fcntl", "fdopen", "fileno", "fnmatch", "fnmatch", "fork",
-"fpathconf", "fpathconf", "fstat", "getcwd", "getegid", "geteuid",
-"getgid", "getgrgid", "getgrnam", "getgroups", "getlogin", "getopt",
-"getpgrp", "getpid", "getppid", "getpwnam", "getpwuid", "getuid",
-"glob", "glob", "globfree", "globfree", "isatty", "kill", "link",
-"lseek", "mkdir", "mkfifo", "open", "opendir", "optarg", "opterr",
-"optind", "optopt", "pathconf", "pathconf", "pause", "pclose", "pipe",
-"popen", "read", "readdir", "regcomp", "regerror", "regexec",
-"regfree", "rewinddir", "rmdir", "setgid", "setpgid", "setsid",
-"setuid", "sigaction", "sigaddset", "sigdelset", "sigemptyset",
-"sigfillset", "sigismember", "siglongjmp", "sigpending",
-"sigprocmask", "sigsetjmp", "sigsuspend", "sleep", "stat", "sysconf",
-"sysconf", "tcdrain", "tcflow", "tcflush", "tcgetattr", "tcgetpgrp",
-"tcsendbreak", "tcsetattr", "tcsetpgrp", "times", "ttyname", "tzset",
-"umask", "uname", "unlink", "utime", "wait", "waitpid", "wordexp",
-"wordfree", "write", 0 };
+char *posix_fns[] = { "_exit", "_longjmp", "_setjmp",
+"_tolower", "_toupper", "a64l", "accept", "access", "alarm",
+"asctime_r", "basename", "bcmp", "bcopy", "bind", "bzero",
+"catclose", "catgets", "catopen",
+"cfgetispeed", "cfgetospeed", "cfsetispeed", "cfsetospeed",
+"chdir", "chmod", "chown", "close", "closedir", "closelog",
+"confstr", "connect", "creat", "ctermid", "ctime_r",
+"dbm_clearerr", "dbm_close", "dbm_delete", "dbm_error", "dbm_fetch",
+"dbm_firstkey", "dbm_nextkey", "dbm_open", "dbm_store", "dirname",
+"dlclose", "dlerror", "dlopen", "dlsym", "drand48", "dup", "dup2",
+"ecvt", "endgrent", "endhostent", "endnetent", "endprotoent", "endpwent",
+"endservent", "endutxent", "erand48",
+"execl", "execle", "execlp", "execv", "execve", "execvp",
+"fchdir", "fchmod", "fchown", "fcntl", "fcvt", "fdopen", "ffs", "fileno",
+"flockfile", "fmtmsg", "fnmatch", "fork", "fpathconf", "freeaddrinfo",
+"fseeko", "fstat", "fstatvfs", "fsync", "ftello", "ftime", "ftok",
+"ftruncate", "ftrylockfile", "ftw", "funlockfile", "gcvt", "getaddrinfo",
+"getc_unlocked", "getchar_unlocked", "getcontext", "getcwd",
+"getdate", "getegid", "geteuid", "getgid", "getgrent",
+"getgrgid", "getgrgid_r", "getgrnam", "getgrnam_r", "getgroups",
+"gethostbyaddr", "gethostbyname", "gethostent", "gethostid",
+"gethostname", "getitimer", "getlogin", "getlogin_r", "getnameinfo",
+"getnetbyaddr", "getnetbyname", "getnetent", "getopt", "getpeername",
+"getpgid", "getpgrp", "getpid", "getppid", "getpriority",
+"getprotobyname", "getprotobynumber", "getprotoent", "getpwent",
+"getpwnam", "getpwnam_r", "getpwuid", "getpwuid_r", "getrlimit",
+"getrusage", "getservbyname", "getservbyport", "getservent", "getsid",
+"getsockname", "getsockopt", "getsubopt", "gettimeofday",
+"getuid", "getutxent", "getutxid", "getutxline", "getwd",
+"glob", "globfree", "gmtime_r", "grantpt",
+"h_errno", "hcreate", "hdestroy", "hsearch",
+"htonl", "htons", "iconv", "iconv_close", "iconv_open",
+"if_freenameindex", "if_indextoname", "if_nameindex", "if_nametoindex",
+"index", "inet_addr", "inet_ntoa", "inet_ntop", "inet_pton",
+"initstate", "insque", "isascii", "isatty",
+"j0", "j1", "jn", "jrand48", "kill", "killpg", "l64a", "lchown",
+"lcong48", "lfind", "link", "listen", "localtime_r", "lockf",
+"lrand48", "lsearch", "lseek", "lstat", "makecontext", "memccpy",
+"mkdir", "mkfifo", "mknod", "mkstemp", "mktemp", "mmap", "mprotect",
+"mrand48", "msgctl", "msgget", "msgrcv", "msgsnd", "msync",
+"munmap", "nftw", "nice", "nl_langinfo", "nrand48", "ntohl", "ntohs",
+"open", "opendir", "openlog", "optarg", "opterr", "optind", "optopt",
+"pathconf", "pause", "pclose", "pipe", "poll", "popen", "pread",
+"pselect", "putc_unlocked", "putchar_unlocked", "putenv",
+"pututxline", "pwrite", "rand_r", "random", "read",
+"readdir", "readdir_r", "readlink", "readv", "realpath",
+"recv", "recvfrom", "recvmsg",
+"regcomp", "regerror", "regexec", "regfree", "remque", "rewinddir",
+"rindex", "rmdir", "scalb", "sched_yield", "seed48",
+"seekdir", "select", "semctl", "semget", "semop",
+"send", "sendmsg", "sendto", "setcontext", "setegid", "setenv", "seteuid",
+"setgid", "setgrent", "sethostent", "setitimer", "setlogmask",
+"setnetent", "setpgid", "setpgrp", "setpriority", "setprotoent",
+"setpwent", "setregid", "setreuid", "setrlimit", "setservent", "setsid",
+"setsockopt", "setstate", "setuid", "setutxent",
+"shmat", "shmctl", "shmdt", "shmget", "shutdown",
+"sigaction", "sigaddset", "sigaltstack", "sigdelset", "sigemptyset",
+"sigfillset", "sighold", "sigignore", "siginterrupt", "sigismember",
+"siglongjmp", "sigpause", "sigpending", "sigprocmask", "sigrelse",
+"sigset", "sigsetjmp", "sigsuspend", "sigwait", "sleep",
+"sockatmark", "socket", "socketpair", "srand48",
+"srandom", "stat", "statvfs", "strcasecmp", "strdup", "strerror_r",
+"strfmon", "strftime", "strncasecmp", "strptime", "strtok_r",
+"swab", "swapcontext", "symlink", "sync", "sysconf", "syslog",
+"tcdrain", "tcflow", "tcflush", "tcgetattr", "tcgetpgrp",
+"tcgetsid", "tcsendbreak", "tcsetattr", "tcsetpgrp",
+"tdelete", "telldir", "tempnam", "tfind", "times", "toascii",
+"truncate", "tsearch", "ttyname", "ttyname_r",
+"twalk", "tzset", "ualarm", "ulimit", "umask", "uname",
+"unlink", "unlockpt", "unsetenv", "usleep", "utime", "utimes",
+"vfork", "wait", "waitid", "waitpid",
+"wcswcs", "wcswidth", "wcwidth",
+"wordexp", "wordfree", "write", "writev",
+"y0", "y1", "yn", 0
+};
 
 #define Tansi	0x01
 #define Tposix	0x02

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019