diff options
| author | Joakim Verona | 2013-02-13 00:04:17 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-13 00:04:17 +0100 |
| commit | e46029ad6dda065541c8de40de0fe9d5800ac770 (patch) | |
| tree | 891ff36967b0ef02459ee46b6363b75bf810d524 | |
| parent | e0444a0966fa001953bb97cfb60451c42220be8e (diff) | |
| parent | c4131562319d3529841136d236ac39fb1e3d2b7c (diff) | |
| download | emacs-e46029ad6dda065541c8de40de0fe9d5800ac770.tar.gz emacs-e46029ad6dda065541c8de40de0fe9d5800ac770.zip | |
auto upstream
53 files changed, 2353 insertions, 261 deletions
| @@ -1,3 +1,20 @@ | |||
| 1 | 2013-02-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O). | ||
| 4 | ($(BLD)/memrchr.$(O)): New dependency. | ||
| 5 | |||
| 6 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> | ||
| 7 | |||
| 8 | Tune by using memchr and memrchr. | ||
| 9 | * .bzrignore: Add string.h. | ||
| 10 | * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. | ||
| 11 | * lib/memrchr.c, lib/string.in.h, m4/memrchr.m4, m4/string_h.m4: | ||
| 12 | New files, from gnulib. | ||
| 13 | |||
| 14 | Merge from gnulib, incorporating: | ||
| 15 | 2013-02-11 unsetenv etc.: port to Solaris 11 + GNU Emacs | ||
| 16 | 2013-02-09 secure_getenv: fix C++ declaration typo | ||
| 17 | |||
| 1 | 2013-02-11 Glenn Morris <rgm@gnu.org> | 18 | 2013-02-11 Glenn Morris <rgm@gnu.org> |
| 2 | 19 | ||
| 3 | * configure.ac (emacs_config_options): Record some env vars. | 20 | * configure.ac (emacs_config_options): Record some env vars. |
diff --git a/admin/ChangeLog b/admin/ChangeLog index 76ac11446a3..7e72e10cd9f 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Tune by using memchr and memrchr. | ||
| 4 | * merge-gnulib (GNULIB_MODULES): Add memrchr. | ||
| 5 | |||
| 1 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539). | 8 | Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539). |
diff --git a/admin/merge-gnulib b/admin/merge-gnulib index e90e2e23b29..b43f2bd9bb8 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib | |||
| @@ -31,7 +31,8 @@ GNULIB_MODULES=' | |||
| 31 | dtoastr dtotimespec dup2 environ execinfo faccessat | 31 | dtoastr dtotimespec dup2 environ execinfo faccessat |
| 32 | fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday | 32 | fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday |
| 33 | ignore-value intprops largefile lstat | 33 | ignore-value intprops largefile lstat |
| 34 | manywarnings mktime pselect pthread_sigmask putenv readlink readlinkat | 34 | manywarnings memrchr mktime |
| 35 | pselect pthread_sigmask putenv readlink readlinkat | ||
| 35 | sig2str socklen stat-time stdalign stdarg stdbool stdio | 36 | sig2str socklen stat-time stdalign stdarg stdbool stdio |
| 36 | strftime strtoimax strtoumax symlink sys_stat | 37 | strftime strtoimax strtoumax symlink sys_stat |
| 37 | sys_time time timer-time timespec-add timespec-sub unsetenv utimens | 38 | sys_time time timer-time timespec-add timespec-sub unsetenv utimens |
diff --git a/autogen/Makefile.in b/autogen/Makefile.in index f4bc918fa49..65d3880c027 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | # the same distribution terms as the rest of that program. | 36 | # the same distribution terms as the rest of that program. |
| 37 | # | 37 | # |
| 38 | # Generated by gnulib-tool. | 38 | # Generated by gnulib-tool. |
| 39 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings | 39 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings |
| 40 | 40 | ||
| 41 | VPATH = @srcdir@ | 41 | VPATH = @srcdir@ |
| 42 | pkgdatadir = $(datadir)/@PACKAGE@ | 42 | pkgdatadir = $(datadir)/@PACKAGE@ |
| @@ -82,10 +82,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ | |||
| 82 | $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ | 82 | $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ |
| 83 | $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/longlong.m4 \ | 83 | $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/longlong.m4 \ |
| 84 | $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/manywarnings.m4 \ | 84 | $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/manywarnings.m4 \ |
| 85 | $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ | 85 | $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memrchr.m4 \ |
| 86 | $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ | 86 | $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/multiarch.m4 \ |
| 87 | $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/pathmax.m4 \ | 87 | $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \ |
| 88 | $(top_srcdir)/m4/pselect.m4 \ | 88 | $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pselect.m4 \ |
| 89 | $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \ | 89 | $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \ |
| 90 | $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readlinkat.m4 \ | 90 | $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readlinkat.m4 \ |
| 91 | $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sha1.m4 \ | 91 | $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sha1.m4 \ |
| @@ -97,10 +97,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ | |||
| 97 | $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ | 97 | $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ |
| 98 | $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ | 98 | $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ |
| 99 | $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ | 99 | $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ |
| 100 | $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strtoimax.m4 \ | 100 | $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/string_h.m4 \ |
| 101 | $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoull.m4 \ | 101 | $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtoll.m4 \ |
| 102 | $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ | 102 | $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ |
| 103 | $(top_srcdir)/m4/sys_select_h.m4 \ | 103 | $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_select_h.m4 \ |
| 104 | $(top_srcdir)/m4/sys_socket_h.m4 \ | 104 | $(top_srcdir)/m4/sys_socket_h.m4 \ |
| 105 | $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ | 105 | $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ |
| 106 | $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ | 106 | $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ |
| @@ -229,6 +229,8 @@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ | |||
| 229 | GNULIB_FDOPEN = @GNULIB_FDOPEN@ | 229 | GNULIB_FDOPEN = @GNULIB_FDOPEN@ |
| 230 | GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@ | 230 | GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@ |
| 231 | GNULIB_FFLUSH = @GNULIB_FFLUSH@ | 231 | GNULIB_FFLUSH = @GNULIB_FFLUSH@ |
| 232 | GNULIB_FFSL = @GNULIB_FFSL@ | ||
| 233 | GNULIB_FFSLL = @GNULIB_FFSLL@ | ||
| 232 | GNULIB_FGETC = @GNULIB_FGETC@ | 234 | GNULIB_FGETC = @GNULIB_FGETC@ |
| 233 | GNULIB_FGETS = @GNULIB_FGETS@ | 235 | GNULIB_FGETS = @GNULIB_FGETS@ |
| 234 | GNULIB_FOPEN = @GNULIB_FOPEN@ | 236 | GNULIB_FOPEN = @GNULIB_FOPEN@ |
| @@ -279,7 +281,25 @@ GNULIB_LINKAT = @GNULIB_LINKAT@ | |||
| 279 | GNULIB_LSEEK = @GNULIB_LSEEK@ | 281 | GNULIB_LSEEK = @GNULIB_LSEEK@ |
| 280 | GNULIB_LSTAT = @GNULIB_LSTAT@ | 282 | GNULIB_LSTAT = @GNULIB_LSTAT@ |
| 281 | GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ | 283 | GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ |
| 284 | GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ | ||
| 285 | GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ | ||
| 286 | GNULIB_MBSCHR = @GNULIB_MBSCHR@ | ||
| 287 | GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ | ||
| 288 | GNULIB_MBSLEN = @GNULIB_MBSLEN@ | ||
| 289 | GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ | ||
| 290 | GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ | ||
| 291 | GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ | ||
| 292 | GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ | ||
| 293 | GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ | ||
| 294 | GNULIB_MBSSEP = @GNULIB_MBSSEP@ | ||
| 295 | GNULIB_MBSSPN = @GNULIB_MBSSPN@ | ||
| 296 | GNULIB_MBSSTR = @GNULIB_MBSSTR@ | ||
| 297 | GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ | ||
| 282 | GNULIB_MBTOWC = @GNULIB_MBTOWC@ | 298 | GNULIB_MBTOWC = @GNULIB_MBTOWC@ |
| 299 | GNULIB_MEMCHR = @GNULIB_MEMCHR@ | ||
| 300 | GNULIB_MEMMEM = @GNULIB_MEMMEM@ | ||
| 301 | GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ | ||
| 302 | GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ | ||
| 283 | GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ | 303 | GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ |
| 284 | GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ | 304 | GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ |
| 285 | GNULIB_MKFIFO = @GNULIB_MKFIFO@ | 305 | GNULIB_MKFIFO = @GNULIB_MKFIFO@ |
| @@ -319,6 +339,7 @@ GNULIB_PWRITE = @GNULIB_PWRITE@ | |||
| 319 | GNULIB_RAISE = @GNULIB_RAISE@ | 339 | GNULIB_RAISE = @GNULIB_RAISE@ |
| 320 | GNULIB_RANDOM = @GNULIB_RANDOM@ | 340 | GNULIB_RANDOM = @GNULIB_RANDOM@ |
| 321 | GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ | 341 | GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ |
| 342 | GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ | ||
| 322 | GNULIB_READ = @GNULIB_READ@ | 343 | GNULIB_READ = @GNULIB_READ@ |
| 323 | GNULIB_READDIR = @GNULIB_READDIR@ | 344 | GNULIB_READDIR = @GNULIB_READDIR@ |
| 324 | GNULIB_READLINK = @GNULIB_READLINK@ | 345 | GNULIB_READLINK = @GNULIB_READLINK@ |
| @@ -346,12 +367,28 @@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ | |||
| 346 | GNULIB_STAT = @GNULIB_STAT@ | 367 | GNULIB_STAT = @GNULIB_STAT@ |
| 347 | GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ | 368 | GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ |
| 348 | GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ | 369 | GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ |
| 370 | GNULIB_STPCPY = @GNULIB_STPCPY@ | ||
| 371 | GNULIB_STPNCPY = @GNULIB_STPNCPY@ | ||
| 372 | GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ | ||
| 373 | GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ | ||
| 374 | GNULIB_STRDUP = @GNULIB_STRDUP@ | ||
| 375 | GNULIB_STRERROR = @GNULIB_STRERROR@ | ||
| 376 | GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ | ||
| 377 | GNULIB_STRNCAT = @GNULIB_STRNCAT@ | ||
| 378 | GNULIB_STRNDUP = @GNULIB_STRNDUP@ | ||
| 379 | GNULIB_STRNLEN = @GNULIB_STRNLEN@ | ||
| 380 | GNULIB_STRPBRK = @GNULIB_STRPBRK@ | ||
| 349 | GNULIB_STRPTIME = @GNULIB_STRPTIME@ | 381 | GNULIB_STRPTIME = @GNULIB_STRPTIME@ |
| 382 | GNULIB_STRSEP = @GNULIB_STRSEP@ | ||
| 383 | GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ | ||
| 384 | GNULIB_STRSTR = @GNULIB_STRSTR@ | ||
| 350 | GNULIB_STRTOD = @GNULIB_STRTOD@ | 385 | GNULIB_STRTOD = @GNULIB_STRTOD@ |
| 351 | GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ | 386 | GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ |
| 387 | GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ | ||
| 352 | GNULIB_STRTOLL = @GNULIB_STRTOLL@ | 388 | GNULIB_STRTOLL = @GNULIB_STRTOLL@ |
| 353 | GNULIB_STRTOULL = @GNULIB_STRTOULL@ | 389 | GNULIB_STRTOULL = @GNULIB_STRTOULL@ |
| 354 | GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ | 390 | GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ |
| 391 | GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ | ||
| 355 | GNULIB_SYMLINK = @GNULIB_SYMLINK@ | 392 | GNULIB_SYMLINK = @GNULIB_SYMLINK@ |
| 356 | GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ | 393 | GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ |
| 357 | GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ | 394 | GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ |
| @@ -416,11 +453,19 @@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ | |||
| 416 | HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ | 453 | HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ |
| 417 | HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ | 454 | HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ |
| 418 | HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ | 455 | HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ |
| 456 | HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ | ||
| 457 | HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ | ||
| 419 | HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ | 458 | HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ |
| 420 | HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ | 459 | HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ |
| 421 | HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ | 460 | HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ |
| 422 | HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ | 461 | HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ |
| 462 | HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ | ||
| 463 | HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ | ||
| 464 | HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ | ||
| 465 | HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ | ||
| 466 | HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ | ||
| 423 | HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ | 467 | HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ |
| 468 | HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ | ||
| 424 | HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ | 469 | HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ |
| 425 | HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ | 470 | HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ |
| 426 | HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ | 471 | HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ |
| @@ -437,6 +482,8 @@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ | |||
| 437 | HAVE_FCNTL = @HAVE_FCNTL@ | 482 | HAVE_FCNTL = @HAVE_FCNTL@ |
| 438 | HAVE_FDATASYNC = @HAVE_FDATASYNC@ | 483 | HAVE_FDATASYNC = @HAVE_FDATASYNC@ |
| 439 | HAVE_FDOPENDIR = @HAVE_FDOPENDIR@ | 484 | HAVE_FDOPENDIR = @HAVE_FDOPENDIR@ |
| 485 | HAVE_FFSL = @HAVE_FFSL@ | ||
| 486 | HAVE_FFSLL = @HAVE_FFSLL@ | ||
| 440 | HAVE_FSEEKO = @HAVE_FSEEKO@ | 487 | HAVE_FSEEKO = @HAVE_FSEEKO@ |
| 441 | HAVE_FSTATAT = @HAVE_FSTATAT@ | 488 | HAVE_FSTATAT = @HAVE_FSTATAT@ |
| 442 | HAVE_FSYNC = @HAVE_FSYNC@ | 489 | HAVE_FSYNC = @HAVE_FSYNC@ |
| @@ -461,6 +508,9 @@ HAVE_LINKAT = @HAVE_LINKAT@ | |||
| 461 | HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ | 508 | HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ |
| 462 | HAVE_LSTAT = @HAVE_LSTAT@ | 509 | HAVE_LSTAT = @HAVE_LSTAT@ |
| 463 | HAVE_MAKEINFO = @HAVE_MAKEINFO@ | 510 | HAVE_MAKEINFO = @HAVE_MAKEINFO@ |
| 511 | HAVE_MBSLEN = @HAVE_MBSLEN@ | ||
| 512 | HAVE_MEMCHR = @HAVE_MEMCHR@ | ||
| 513 | HAVE_MEMPCPY = @HAVE_MEMPCPY@ | ||
| 464 | HAVE_MKDIRAT = @HAVE_MKDIRAT@ | 514 | HAVE_MKDIRAT = @HAVE_MKDIRAT@ |
| 465 | HAVE_MKDTEMP = @HAVE_MKDTEMP@ | 515 | HAVE_MKDTEMP = @HAVE_MKDTEMP@ |
| 466 | HAVE_MKFIFO = @HAVE_MKFIFO@ | 516 | HAVE_MKFIFO = @HAVE_MKFIFO@ |
| @@ -491,6 +541,7 @@ HAVE_RAISE = @HAVE_RAISE@ | |||
| 491 | HAVE_RANDOM = @HAVE_RANDOM@ | 541 | HAVE_RANDOM = @HAVE_RANDOM@ |
| 492 | HAVE_RANDOM_H = @HAVE_RANDOM_H@ | 542 | HAVE_RANDOM_H = @HAVE_RANDOM_H@ |
| 493 | HAVE_RANDOM_R = @HAVE_RANDOM_R@ | 543 | HAVE_RANDOM_R = @HAVE_RANDOM_R@ |
| 544 | HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ | ||
| 494 | HAVE_READDIR = @HAVE_READDIR@ | 545 | HAVE_READDIR = @HAVE_READDIR@ |
| 495 | HAVE_READLINK = @HAVE_READLINK@ | 546 | HAVE_READLINK = @HAVE_READLINK@ |
| 496 | HAVE_READLINKAT = @HAVE_READLINKAT@ | 547 | HAVE_READLINKAT = @HAVE_READLINKAT@ |
| @@ -511,13 +562,20 @@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ | |||
| 511 | HAVE_SIGSET_T = @HAVE_SIGSET_T@ | 562 | HAVE_SIGSET_T = @HAVE_SIGSET_T@ |
| 512 | HAVE_SLEEP = @HAVE_SLEEP@ | 563 | HAVE_SLEEP = @HAVE_SLEEP@ |
| 513 | HAVE_STDINT_H = @HAVE_STDINT_H@ | 564 | HAVE_STDINT_H = @HAVE_STDINT_H@ |
| 565 | HAVE_STPCPY = @HAVE_STPCPY@ | ||
| 566 | HAVE_STPNCPY = @HAVE_STPNCPY@ | ||
| 567 | HAVE_STRCASESTR = @HAVE_STRCASESTR@ | ||
| 568 | HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ | ||
| 569 | HAVE_STRPBRK = @HAVE_STRPBRK@ | ||
| 514 | HAVE_STRPTIME = @HAVE_STRPTIME@ | 570 | HAVE_STRPTIME = @HAVE_STRPTIME@ |
| 571 | HAVE_STRSEP = @HAVE_STRSEP@ | ||
| 515 | HAVE_STRTOD = @HAVE_STRTOD@ | 572 | HAVE_STRTOD = @HAVE_STRTOD@ |
| 516 | HAVE_STRTOLL = @HAVE_STRTOLL@ | 573 | HAVE_STRTOLL = @HAVE_STRTOLL@ |
| 517 | HAVE_STRTOULL = @HAVE_STRTOULL@ | 574 | HAVE_STRTOULL = @HAVE_STRTOULL@ |
| 518 | HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ | 575 | HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ |
| 519 | HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ | 576 | HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ |
| 520 | HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ | 577 | HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ |
| 578 | HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ | ||
| 521 | HAVE_SYMLINK = @HAVE_SYMLINK@ | 579 | HAVE_SYMLINK = @HAVE_SYMLINK@ |
| 522 | HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ | 580 | HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ |
| 523 | HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ | 581 | HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ |
| @@ -625,6 +683,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ | |||
| 625 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ | 683 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ |
| 626 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ | 684 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ |
| 627 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ | 685 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ |
| 686 | NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ | ||
| 628 | NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ | 687 | NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@ |
| 629 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ | 688 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ |
| 630 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ | 689 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ |
| @@ -640,6 +699,7 @@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ | |||
| 640 | NEXT_STDINT_H = @NEXT_STDINT_H@ | 699 | NEXT_STDINT_H = @NEXT_STDINT_H@ |
| 641 | NEXT_STDIO_H = @NEXT_STDIO_H@ | 700 | NEXT_STDIO_H = @NEXT_STDIO_H@ |
| 642 | NEXT_STDLIB_H = @NEXT_STDLIB_H@ | 701 | NEXT_STDLIB_H = @NEXT_STDLIB_H@ |
| 702 | NEXT_STRING_H = @NEXT_STRING_H@ | ||
| 643 | NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ | 703 | NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ |
| 644 | NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ | 704 | NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ |
| 645 | NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ | 705 | NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ |
| @@ -717,6 +777,8 @@ REPLACE_LSEEK = @REPLACE_LSEEK@ | |||
| 717 | REPLACE_LSTAT = @REPLACE_LSTAT@ | 777 | REPLACE_LSTAT = @REPLACE_LSTAT@ |
| 718 | REPLACE_MALLOC = @REPLACE_MALLOC@ | 778 | REPLACE_MALLOC = @REPLACE_MALLOC@ |
| 719 | REPLACE_MBTOWC = @REPLACE_MBTOWC@ | 779 | REPLACE_MBTOWC = @REPLACE_MBTOWC@ |
| 780 | REPLACE_MEMCHR = @REPLACE_MEMCHR@ | ||
| 781 | REPLACE_MEMMEM = @REPLACE_MEMMEM@ | ||
| 720 | REPLACE_MKDIR = @REPLACE_MKDIR@ | 782 | REPLACE_MKDIR = @REPLACE_MKDIR@ |
| 721 | REPLACE_MKFIFO = @REPLACE_MKFIFO@ | 783 | REPLACE_MKFIFO = @REPLACE_MKFIFO@ |
| 722 | REPLACE_MKNOD = @REPLACE_MKNOD@ | 784 | REPLACE_MKNOD = @REPLACE_MKNOD@ |
| @@ -756,8 +818,20 @@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ | |||
| 756 | REPLACE_STAT = @REPLACE_STAT@ | 818 | REPLACE_STAT = @REPLACE_STAT@ |
| 757 | REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ | 819 | REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ |
| 758 | REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ | 820 | REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ |
| 821 | REPLACE_STPNCPY = @REPLACE_STPNCPY@ | ||
| 822 | REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ | ||
| 823 | REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ | ||
| 824 | REPLACE_STRDUP = @REPLACE_STRDUP@ | ||
| 825 | REPLACE_STRERROR = @REPLACE_STRERROR@ | ||
| 826 | REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ | ||
| 827 | REPLACE_STRNCAT = @REPLACE_STRNCAT@ | ||
| 828 | REPLACE_STRNDUP = @REPLACE_STRNDUP@ | ||
| 829 | REPLACE_STRNLEN = @REPLACE_STRNLEN@ | ||
| 830 | REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ | ||
| 831 | REPLACE_STRSTR = @REPLACE_STRSTR@ | ||
| 759 | REPLACE_STRTOD = @REPLACE_STRTOD@ | 832 | REPLACE_STRTOD = @REPLACE_STRTOD@ |
| 760 | REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ | 833 | REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ |
| 834 | REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ | ||
| 761 | REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ | 835 | REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ |
| 762 | REPLACE_SYMLINK = @REPLACE_SYMLINK@ | 836 | REPLACE_SYMLINK = @REPLACE_SYMLINK@ |
| 763 | REPLACE_TIMEGM = @REPLACE_TIMEGM@ | 837 | REPLACE_TIMEGM = @REPLACE_TIMEGM@ |
| @@ -798,6 +872,7 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ | |||
| 798 | TOOLKIT_LIBW = @TOOLKIT_LIBW@ | 872 | TOOLKIT_LIBW = @TOOLKIT_LIBW@ |
| 799 | UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ | 873 | UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ |
| 800 | UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ | 874 | UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ |
| 875 | UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ | ||
| 801 | UNEXEC_OBJ = @UNEXEC_OBJ@ | 876 | UNEXEC_OBJ = @UNEXEC_OBJ@ |
| 802 | UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ | 877 | UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ |
| 803 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ | 878 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ |
| @@ -912,8 +987,8 @@ x_default_search_path = @x_default_search_path@ | |||
| 912 | BUILT_SOURCES = $(ALLOCA_H) dirent.h $(EXECINFO_H) fcntl.h $(GETOPT_H) \ | 987 | BUILT_SOURCES = $(ALLOCA_H) dirent.h $(EXECINFO_H) fcntl.h $(GETOPT_H) \ |
| 913 | inttypes.h signal.h arg-nonnull.h c++defs.h warn-on-use.h \ | 988 | inttypes.h signal.h arg-nonnull.h c++defs.h warn-on-use.h \ |
| 914 | $(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ | 989 | $(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ |
| 915 | stdio.h stdlib.h sys/select.h sys/stat.h sys/time.h time.h \ | 990 | stdio.h stdlib.h string.h sys/select.h sys/stat.h sys/time.h \ |
| 916 | unistd.h | 991 | time.h unistd.h |
| 917 | EXTRA_DIST = alloca.in.h allocator.h openat-priv.h openat-proc.c \ | 992 | EXTRA_DIST = alloca.in.h allocator.h openat-priv.h openat-proc.c \ |
| 918 | careadlinkat.h close-stream.h md5.h sha1.h sha256.h sha512.h \ | 993 | careadlinkat.h close-stream.h md5.h sha1.h sha256.h sha512.h \ |
| 919 | dirent.in.h dosname.h ftoastr.c ftoastr.h dup2.c euidaccess.c \ | 994 | dirent.in.h dosname.h ftoastr.c ftoastr.h dup2.c euidaccess.c \ |
| @@ -921,7 +996,7 @@ EXTRA_DIST = alloca.in.h allocator.h openat-priv.h openat-proc.c \ | |||
| 921 | fdopendir.c filemode.h fpending.c fpending.h at-func.c \ | 996 | fdopendir.c filemode.h fpending.c fpending.h at-func.c \ |
| 922 | fstatat.c getgroups.c getloadavg.c getopt.c getopt.in.h \ | 997 | fstatat.c getgroups.c getloadavg.c getopt.c getopt.in.h \ |
| 923 | getopt1.c getopt_int.h gettimeofday.c group-member.c \ | 998 | getopt1.c getopt_int.h gettimeofday.c group-member.c \ |
| 924 | ignore-value.h intprops.h inttypes.in.h lstat.c \ | 999 | ignore-value.h intprops.h inttypes.in.h lstat.c memrchr.c \ |
| 925 | mktime-internal.h mktime.c openat.h pathmax.h pselect.c \ | 1000 | mktime-internal.h mktime.c openat.h pathmax.h pselect.c \ |
| 926 | pthread_sigmask.c putenv.c readlink.c at-func.c readlinkat.c \ | 1001 | pthread_sigmask.c putenv.c readlink.c at-func.c readlinkat.c \ |
| 927 | root-uid.h sig2str.c sig2str.h signal.in.h \ | 1002 | root-uid.h sig2str.c sig2str.h signal.in.h \ |
| @@ -930,11 +1005,12 @@ EXTRA_DIST = alloca.in.h allocator.h openat-priv.h openat-proc.c \ | |||
| 930 | $(top_srcdir)/build-aux/snippet/c++defs.h \ | 1005 | $(top_srcdir)/build-aux/snippet/c++defs.h \ |
| 931 | $(top_srcdir)/build-aux/snippet/warn-on-use.h stat.c \ | 1006 | $(top_srcdir)/build-aux/snippet/warn-on-use.h stat.c \ |
| 932 | stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h stddef.in.h \ | 1007 | stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h stddef.in.h \ |
| 933 | stdint.in.h stdio.in.h stdlib.in.h strftime.h strtoimax.c \ | 1008 | stdint.in.h stdio.in.h stdlib.in.h strftime.h string.in.h \ |
| 934 | strtol.c strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ | 1009 | strtoimax.c strtol.c strtoll.c strtol.c strtoul.c strtoull.c \ |
| 935 | strtoumax.c symlink.c sys_select.in.h sys_stat.in.h \ | 1010 | strtoimax.c strtoumax.c symlink.c sys_select.in.h \ |
| 936 | sys_time.in.h time.in.h time_r.c timespec.h u64.h unistd.in.h \ | 1011 | sys_stat.in.h sys_time.in.h time.in.h time_r.c timespec.h \ |
| 937 | unsetenv.c utimens.h verify.h xalloc-oversized.h | 1012 | u64.h unistd.in.h unsetenv.c utimens.h verify.h \ |
| 1013 | xalloc-oversized.h | ||
| 938 | MOSTLYCLEANDIRS = sys sys | 1014 | MOSTLYCLEANDIRS = sys sys |
| 939 | MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ | 1015 | MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ |
| 940 | dirent.h-t execinfo.h execinfo.h-t fcntl.h fcntl.h-t getopt.h \ | 1016 | dirent.h-t execinfo.h execinfo.h-t fcntl.h fcntl.h-t getopt.h \ |
| @@ -942,9 +1018,9 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ | |||
| 942 | arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ | 1018 | arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ |
| 943 | warn-on-use.h warn-on-use.h-t stdalign.h stdalign.h-t stdarg.h \ | 1019 | warn-on-use.h warn-on-use.h-t stdalign.h stdalign.h-t stdarg.h \ |
| 944 | stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \ | 1020 | stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \ |
| 945 | stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t sys/select.h \ | 1021 | stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t string.h \ |
| 946 | sys/select.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ | 1022 | string.h-t sys/select.h sys/select.h-t sys/stat.h sys/stat.h-t \ |
| 947 | time.h time.h-t unistd.h unistd.h-t | 1023 | sys/time.h sys/time.h-t time.h time.h-t unistd.h unistd.h-t |
| 948 | noinst_LIBRARIES = libgnu.a | 1024 | noinst_LIBRARIES = libgnu.a |
| 949 | AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) | 1025 | AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) |
| 950 | DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src | 1026 | DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src |
| @@ -959,11 +1035,11 @@ libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) | |||
| 959 | EXTRA_libgnu_a_SOURCES = openat-proc.c ftoastr.c dup2.c euidaccess.c \ | 1035 | EXTRA_libgnu_a_SOURCES = openat-proc.c ftoastr.c dup2.c euidaccess.c \ |
| 960 | execinfo.c at-func.c faccessat.c fdopendir.c fpending.c \ | 1036 | execinfo.c at-func.c faccessat.c fdopendir.c fpending.c \ |
| 961 | at-func.c fstatat.c getgroups.c getloadavg.c getopt.c \ | 1037 | at-func.c fstatat.c getgroups.c getloadavg.c getopt.c \ |
| 962 | getopt1.c gettimeofday.c group-member.c lstat.c mktime.c \ | 1038 | getopt1.c gettimeofday.c group-member.c lstat.c memrchr.c \ |
| 963 | pselect.c pthread_sigmask.c putenv.c readlink.c at-func.c \ | 1039 | mktime.c pselect.c pthread_sigmask.c putenv.c readlink.c \ |
| 964 | readlinkat.c sig2str.c stat.c strtoimax.c strtol.c strtoll.c \ | 1040 | at-func.c readlinkat.c sig2str.c stat.c strtoimax.c strtol.c \ |
| 965 | strtol.c strtoul.c strtoull.c strtoimax.c strtoumax.c \ | 1041 | strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ |
| 966 | symlink.c time_r.c unsetenv.c | 1042 | strtoumax.c symlink.c time_r.c unsetenv.c |
| 967 | 1043 | ||
| 968 | # Because this Makefile snippet defines a variable used by other | 1044 | # Because this Makefile snippet defines a variable used by other |
| 969 | # gnulib Makefile snippets, it must be present in all Makefile.am that | 1045 | # gnulib Makefile snippets, it must be present in all Makefile.am that |
| @@ -1048,6 +1124,7 @@ distclean-compile: | |||
| 1048 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-member.Po@am__quote@ | 1124 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-member.Po@am__quote@ |
| 1049 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ | 1125 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ |
| 1050 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ | 1126 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ |
| 1127 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ | ||
| 1051 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ | 1128 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ |
| 1052 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ | 1129 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ |
| 1053 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ | 1130 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ |
| @@ -1799,6 +1876,97 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ | |||
| 1799 | } > $@-t && \ | 1876 | } > $@-t && \ |
| 1800 | mv $@-t $@ | 1877 | mv $@-t $@ |
| 1801 | 1878 | ||
| 1879 | # We need the following in order to create <string.h> when the system | ||
| 1880 | # doesn't have one that works with the given compiler. | ||
| 1881 | string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) | ||
| 1882 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 1883 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
| 1884 | sed -e 's|@''GUARD_PREFIX''@|GL|g' \ | ||
| 1885 | -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ | ||
| 1886 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | ||
| 1887 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | ||
| 1888 | -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ | ||
| 1889 | -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ | ||
| 1890 | -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ | ||
| 1891 | -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ | ||
| 1892 | -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ | ||
| 1893 | -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ | ||
| 1894 | -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ | ||
| 1895 | -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ | ||
| 1896 | -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ | ||
| 1897 | -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ | ||
| 1898 | -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ | ||
| 1899 | -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ | ||
| 1900 | -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ | ||
| 1901 | -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ | ||
| 1902 | -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ | ||
| 1903 | -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ | ||
| 1904 | -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ | ||
| 1905 | -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ | ||
| 1906 | -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ | ||
| 1907 | -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ | ||
| 1908 | -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ | ||
| 1909 | -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ | ||
| 1910 | -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ | ||
| 1911 | -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ | ||
| 1912 | -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ | ||
| 1913 | -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ | ||
| 1914 | -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ | ||
| 1915 | -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ | ||
| 1916 | -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ | ||
| 1917 | -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ | ||
| 1918 | -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ | ||
| 1919 | -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ | ||
| 1920 | -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ | ||
| 1921 | -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ | ||
| 1922 | -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ | ||
| 1923 | -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ | ||
| 1924 | -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ | ||
| 1925 | -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ | ||
| 1926 | < $(srcdir)/string.in.h | \ | ||
| 1927 | sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ | ||
| 1928 | -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ | ||
| 1929 | -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ | ||
| 1930 | -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ | ||
| 1931 | -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ | ||
| 1932 | -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ | ||
| 1933 | -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ | ||
| 1934 | -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ | ||
| 1935 | -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ | ||
| 1936 | -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ | ||
| 1937 | -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ | ||
| 1938 | -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ | ||
| 1939 | -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ | ||
| 1940 | -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ | ||
| 1941 | -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ | ||
| 1942 | -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ | ||
| 1943 | -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ | ||
| 1944 | -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ | ||
| 1945 | -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ | ||
| 1946 | -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ | ||
| 1947 | -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ | ||
| 1948 | -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ | ||
| 1949 | -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ | ||
| 1950 | -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ | ||
| 1951 | -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ | ||
| 1952 | -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ | ||
| 1953 | -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ | ||
| 1954 | -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ | ||
| 1955 | -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ | ||
| 1956 | -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ | ||
| 1957 | -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ | ||
| 1958 | -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ | ||
| 1959 | -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ | ||
| 1960 | -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ | ||
| 1961 | -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ | ||
| 1962 | -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ | ||
| 1963 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ | ||
| 1964 | -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ | ||
| 1965 | -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ | ||
| 1966 | < $(srcdir)/string.in.h; \ | ||
| 1967 | } > $@-t && \ | ||
| 1968 | mv $@-t $@ | ||
| 1969 | |||
| 1802 | # We need the following in order to create <sys/select.h> when the system | 1970 | # We need the following in order to create <sys/select.h> when the system |
| 1803 | # doesn't have one that works with the given compiler. | 1971 | # doesn't have one that works with the given compiler. |
| 1804 | sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) | 1972 | sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) |
diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4 index 0f0873ef974..8065a9e643b 100644 --- a/autogen/aclocal.m4 +++ b/autogen/aclocal.m4 | |||
| @@ -1017,6 +1017,7 @@ m4_include([m4/longlong.m4]) | |||
| 1017 | m4_include([m4/lstat.m4]) | 1017 | m4_include([m4/lstat.m4]) |
| 1018 | m4_include([m4/manywarnings.m4]) | 1018 | m4_include([m4/manywarnings.m4]) |
| 1019 | m4_include([m4/md5.m4]) | 1019 | m4_include([m4/md5.m4]) |
| 1020 | m4_include([m4/memrchr.m4]) | ||
| 1020 | m4_include([m4/mktime.m4]) | 1021 | m4_include([m4/mktime.m4]) |
| 1021 | m4_include([m4/multiarch.m4]) | 1022 | m4_include([m4/multiarch.m4]) |
| 1022 | m4_include([m4/nocrash.m4]) | 1023 | m4_include([m4/nocrash.m4]) |
| @@ -1046,6 +1047,7 @@ m4_include([m4/stdint.m4]) | |||
| 1046 | m4_include([m4/stdio_h.m4]) | 1047 | m4_include([m4/stdio_h.m4]) |
| 1047 | m4_include([m4/stdlib_h.m4]) | 1048 | m4_include([m4/stdlib_h.m4]) |
| 1048 | m4_include([m4/strftime.m4]) | 1049 | m4_include([m4/strftime.m4]) |
| 1050 | m4_include([m4/string_h.m4]) | ||
| 1049 | m4_include([m4/strtoimax.m4]) | 1051 | m4_include([m4/strtoimax.m4]) |
| 1050 | m4_include([m4/strtoll.m4]) | 1052 | m4_include([m4/strtoll.m4]) |
| 1051 | m4_include([m4/strtoull.m4]) | 1053 | m4_include([m4/strtoull.m4]) |
diff --git a/autogen/config.in b/autogen/config.in index be52b323fcb..0492fc20110 100644 --- a/autogen/config.in +++ b/autogen/config.in | |||
| @@ -292,6 +292,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 292 | don't. */ | 292 | don't. */ |
| 293 | #undef HAVE_DECL_LOCALTIME_R | 293 | #undef HAVE_DECL_LOCALTIME_R |
| 294 | 294 | ||
| 295 | /* Define to 1 if you have the declaration of `memrchr', and to 0 if you | ||
| 296 | don't. */ | ||
| 297 | #undef HAVE_DECL_MEMRCHR | ||
| 298 | |||
| 295 | /* Define to 1 if you have the declaration of `strmode', and to 0 if you | 299 | /* Define to 1 if you have the declaration of `strmode', and to 0 if you |
| 296 | don't. */ | 300 | don't. */ |
| 297 | #undef HAVE_DECL_STRMODE | 301 | #undef HAVE_DECL_STRMODE |
| @@ -693,6 +697,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 693 | /* Define to 1 if you have the <memory.h> header file. */ | 697 | /* Define to 1 if you have the <memory.h> header file. */ |
| 694 | #undef HAVE_MEMORY_H | 698 | #undef HAVE_MEMORY_H |
| 695 | 699 | ||
| 700 | /* Define to 1 if you have the `memrchr' function. */ | ||
| 701 | #undef HAVE_MEMRCHR | ||
| 702 | |||
| 696 | /* Define to 1 if you have mouse menus. (This is automatic if you use X, but | 703 | /* Define to 1 if you have mouse menus. (This is automatic if you use X, but |
| 697 | the option to specify it remains.) It is also defined with other window | 704 | the option to specify it remains.) It is also defined with other window |
| 698 | systems that support xmenu.c. */ | 705 | systems that support xmenu.c. */ |
diff --git a/autogen/configure b/autogen/configure index 8226d489f72..8f58b87ab20 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -655,6 +655,8 @@ NEXT_TIME_H | |||
| 655 | WINDOWS_64_BIT_ST_SIZE | 655 | WINDOWS_64_BIT_ST_SIZE |
| 656 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H | 656 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H |
| 657 | NEXT_SYS_STAT_H | 657 | NEXT_SYS_STAT_H |
| 658 | NEXT_AS_FIRST_DIRECTIVE_STRING_H | ||
| 659 | NEXT_STRING_H | ||
| 658 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H | 660 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H |
| 659 | NEXT_STDLIB_H | 661 | NEXT_STDLIB_H |
| 660 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H | 662 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H |
| @@ -819,6 +821,79 @@ GNULIB_TIMEGM | |||
| 819 | GNULIB_STRPTIME | 821 | GNULIB_STRPTIME |
| 820 | GNULIB_NANOSLEEP | 822 | GNULIB_NANOSLEEP |
| 821 | GNULIB_MKTIME | 823 | GNULIB_MKTIME |
| 824 | UNDEFINE_STRTOK_R | ||
| 825 | REPLACE_STRTOK_R | ||
| 826 | REPLACE_STRSIGNAL | ||
| 827 | REPLACE_STRNLEN | ||
| 828 | REPLACE_STRNDUP | ||
| 829 | REPLACE_STRNCAT | ||
| 830 | REPLACE_STRERROR_R | ||
| 831 | REPLACE_STRERROR | ||
| 832 | REPLACE_STRCHRNUL | ||
| 833 | REPLACE_STRCASESTR | ||
| 834 | REPLACE_STRSTR | ||
| 835 | REPLACE_STRDUP | ||
| 836 | REPLACE_STPNCPY | ||
| 837 | REPLACE_MEMMEM | ||
| 838 | REPLACE_MEMCHR | ||
| 839 | HAVE_STRVERSCMP | ||
| 840 | HAVE_DECL_STRSIGNAL | ||
| 841 | HAVE_DECL_STRERROR_R | ||
| 842 | HAVE_DECL_STRTOK_R | ||
| 843 | HAVE_STRCASESTR | ||
| 844 | HAVE_STRSEP | ||
| 845 | HAVE_STRPBRK | ||
| 846 | HAVE_DECL_STRNLEN | ||
| 847 | HAVE_DECL_STRNDUP | ||
| 848 | HAVE_DECL_STRDUP | ||
| 849 | HAVE_STRCHRNUL | ||
| 850 | HAVE_STPNCPY | ||
| 851 | HAVE_STPCPY | ||
| 852 | HAVE_RAWMEMCHR | ||
| 853 | HAVE_DECL_MEMRCHR | ||
| 854 | HAVE_MEMPCPY | ||
| 855 | HAVE_DECL_MEMMEM | ||
| 856 | HAVE_MEMCHR | ||
| 857 | HAVE_FFSLL | ||
| 858 | HAVE_FFSL | ||
| 859 | HAVE_MBSLEN | ||
| 860 | GNULIB_STRVERSCMP | ||
| 861 | GNULIB_STRSIGNAL | ||
| 862 | GNULIB_STRERROR_R | ||
| 863 | GNULIB_STRERROR | ||
| 864 | GNULIB_MBSTOK_R | ||
| 865 | GNULIB_MBSSEP | ||
| 866 | GNULIB_MBSSPN | ||
| 867 | GNULIB_MBSPBRK | ||
| 868 | GNULIB_MBSCSPN | ||
| 869 | GNULIB_MBSCASESTR | ||
| 870 | GNULIB_MBSPCASECMP | ||
| 871 | GNULIB_MBSNCASECMP | ||
| 872 | GNULIB_MBSCASECMP | ||
| 873 | GNULIB_MBSSTR | ||
| 874 | GNULIB_MBSRCHR | ||
| 875 | GNULIB_MBSCHR | ||
| 876 | GNULIB_MBSNLEN | ||
| 877 | GNULIB_MBSLEN | ||
| 878 | GNULIB_STRTOK_R | ||
| 879 | GNULIB_STRCASESTR | ||
| 880 | GNULIB_STRSTR | ||
| 881 | GNULIB_STRSEP | ||
| 882 | GNULIB_STRPBRK | ||
| 883 | GNULIB_STRNLEN | ||
| 884 | GNULIB_STRNDUP | ||
| 885 | GNULIB_STRNCAT | ||
| 886 | GNULIB_STRDUP | ||
| 887 | GNULIB_STRCHRNUL | ||
| 888 | GNULIB_STPNCPY | ||
| 889 | GNULIB_STPCPY | ||
| 890 | GNULIB_RAWMEMCHR | ||
| 891 | GNULIB_MEMRCHR | ||
| 892 | GNULIB_MEMPCPY | ||
| 893 | GNULIB_MEMMEM | ||
| 894 | GNULIB_MEMCHR | ||
| 895 | GNULIB_FFSLL | ||
| 896 | GNULIB_FFSL | ||
| 822 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H | 897 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H |
| 823 | NEXT_INTTYPES_H | 898 | NEXT_INTTYPES_H |
| 824 | UINT64_MAX_EQ_ULONG_MAX | 899 | UINT64_MAX_EQ_ULONG_MAX |
| @@ -3377,7 +3452,7 @@ for var in CFLAGS CPPFLAGS LDFLAGS; do | |||
| 3377 | esac | 3452 | esac |
| 3378 | eval val="\$${var}" | 3453 | eval val="\$${var}" |
| 3379 | test x"$val" = x && continue | 3454 | test x"$val" = x && continue |
| 3380 | emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=$val" | 3455 | emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\"" |
| 3381 | done | 3456 | done |
| 3382 | 3457 | ||
| 3383 | ac_config_headers="$ac_config_headers src/config.h:src/config.in" | 3458 | ac_config_headers="$ac_config_headers src/config.h:src/config.in" |
| @@ -7144,6 +7219,7 @@ esac | |||
| 7144 | 7219 | ||
| 7145 | # Code from module lstat: | 7220 | # Code from module lstat: |
| 7146 | # Code from module manywarnings: | 7221 | # Code from module manywarnings: |
| 7222 | # Code from module memrchr: | ||
| 7147 | # Code from module mktime: | 7223 | # Code from module mktime: |
| 7148 | # Code from module multiarch: | 7224 | # Code from module multiarch: |
| 7149 | # Code from module nocrash: | 7225 | # Code from module nocrash: |
| @@ -7176,6 +7252,7 @@ esac | |||
| 7176 | # Code from module stdio: | 7252 | # Code from module stdio: |
| 7177 | # Code from module stdlib: | 7253 | # Code from module stdlib: |
| 7178 | # Code from module strftime: | 7254 | # Code from module strftime: |
| 7255 | # Code from module string: | ||
| 7179 | # Code from module strtoimax: | 7256 | # Code from module strtoimax: |
| 7180 | # Code from module strtoll: | 7257 | # Code from module strtoll: |
| 7181 | # Code from module strtoull: | 7258 | # Code from module strtoull: |
| @@ -19400,6 +19477,92 @@ $as_echo "$gl_cv_type_off_t_64" >&6; } | |||
| 19400 | 19477 | ||
| 19401 | 19478 | ||
| 19402 | 19479 | ||
| 19480 | GNULIB_FFSL=0; | ||
| 19481 | GNULIB_FFSLL=0; | ||
| 19482 | GNULIB_MEMCHR=0; | ||
| 19483 | GNULIB_MEMMEM=0; | ||
| 19484 | GNULIB_MEMPCPY=0; | ||
| 19485 | GNULIB_MEMRCHR=0; | ||
| 19486 | GNULIB_RAWMEMCHR=0; | ||
| 19487 | GNULIB_STPCPY=0; | ||
| 19488 | GNULIB_STPNCPY=0; | ||
| 19489 | GNULIB_STRCHRNUL=0; | ||
| 19490 | GNULIB_STRDUP=0; | ||
| 19491 | GNULIB_STRNCAT=0; | ||
| 19492 | GNULIB_STRNDUP=0; | ||
| 19493 | GNULIB_STRNLEN=0; | ||
| 19494 | GNULIB_STRPBRK=0; | ||
| 19495 | GNULIB_STRSEP=0; | ||
| 19496 | GNULIB_STRSTR=0; | ||
| 19497 | GNULIB_STRCASESTR=0; | ||
| 19498 | GNULIB_STRTOK_R=0; | ||
| 19499 | GNULIB_MBSLEN=0; | ||
| 19500 | GNULIB_MBSNLEN=0; | ||
| 19501 | GNULIB_MBSCHR=0; | ||
| 19502 | GNULIB_MBSRCHR=0; | ||
| 19503 | GNULIB_MBSSTR=0; | ||
| 19504 | GNULIB_MBSCASECMP=0; | ||
| 19505 | GNULIB_MBSNCASECMP=0; | ||
| 19506 | GNULIB_MBSPCASECMP=0; | ||
| 19507 | GNULIB_MBSCASESTR=0; | ||
| 19508 | GNULIB_MBSCSPN=0; | ||
| 19509 | GNULIB_MBSPBRK=0; | ||
| 19510 | GNULIB_MBSSPN=0; | ||
| 19511 | GNULIB_MBSSEP=0; | ||
| 19512 | GNULIB_MBSTOK_R=0; | ||
| 19513 | GNULIB_STRERROR=0; | ||
| 19514 | GNULIB_STRERROR_R=0; | ||
| 19515 | GNULIB_STRSIGNAL=0; | ||
| 19516 | GNULIB_STRVERSCMP=0; | ||
| 19517 | HAVE_MBSLEN=0; | ||
| 19518 | HAVE_FFSL=1; | ||
| 19519 | HAVE_FFSLL=1; | ||
| 19520 | HAVE_MEMCHR=1; | ||
| 19521 | HAVE_DECL_MEMMEM=1; | ||
| 19522 | HAVE_MEMPCPY=1; | ||
| 19523 | HAVE_DECL_MEMRCHR=1; | ||
| 19524 | HAVE_RAWMEMCHR=1; | ||
| 19525 | HAVE_STPCPY=1; | ||
| 19526 | HAVE_STPNCPY=1; | ||
| 19527 | HAVE_STRCHRNUL=1; | ||
| 19528 | HAVE_DECL_STRDUP=1; | ||
| 19529 | HAVE_DECL_STRNDUP=1; | ||
| 19530 | HAVE_DECL_STRNLEN=1; | ||
| 19531 | HAVE_STRPBRK=1; | ||
| 19532 | HAVE_STRSEP=1; | ||
| 19533 | HAVE_STRCASESTR=1; | ||
| 19534 | HAVE_DECL_STRTOK_R=1; | ||
| 19535 | HAVE_DECL_STRERROR_R=1; | ||
| 19536 | HAVE_DECL_STRSIGNAL=1; | ||
| 19537 | HAVE_STRVERSCMP=1; | ||
| 19538 | REPLACE_MEMCHR=0; | ||
| 19539 | REPLACE_MEMMEM=0; | ||
| 19540 | REPLACE_STPNCPY=0; | ||
| 19541 | REPLACE_STRDUP=0; | ||
| 19542 | REPLACE_STRSTR=0; | ||
| 19543 | REPLACE_STRCASESTR=0; | ||
| 19544 | REPLACE_STRCHRNUL=0; | ||
| 19545 | REPLACE_STRERROR=0; | ||
| 19546 | REPLACE_STRERROR_R=0; | ||
| 19547 | REPLACE_STRNCAT=0; | ||
| 19548 | REPLACE_STRNDUP=0; | ||
| 19549 | REPLACE_STRNLEN=0; | ||
| 19550 | REPLACE_STRSIGNAL=0; | ||
| 19551 | REPLACE_STRTOK_R=0; | ||
| 19552 | UNDEFINE_STRTOK_R=0; | ||
| 19553 | |||
| 19554 | ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" | ||
| 19555 | if test "x$ac_cv_have_decl_memrchr" = x""yes; then : | ||
| 19556 | ac_have_decl=1 | ||
| 19557 | else | ||
| 19558 | ac_have_decl=0 | ||
| 19559 | fi | ||
| 19560 | |||
| 19561 | cat >>confdefs.h <<_ACEOF | ||
| 19562 | #define HAVE_DECL_MEMRCHR $ac_have_decl | ||
| 19563 | _ACEOF | ||
| 19564 | |||
| 19565 | |||
| 19403 | GNULIB_MKTIME=0; | 19566 | GNULIB_MKTIME=0; |
| 19404 | GNULIB_NANOSLEEP=0; | 19567 | GNULIB_NANOSLEEP=0; |
| 19405 | GNULIB_STRPTIME=0; | 19568 | GNULIB_STRPTIME=0; |
| @@ -20026,6 +20189,79 @@ fi | |||
| 20026 | 20189 | ||
| 20027 | 20190 | ||
| 20028 | 20191 | ||
| 20192 | |||
| 20193 | |||
| 20194 | |||
| 20195 | |||
| 20196 | |||
| 20197 | |||
| 20198 | |||
| 20199 | |||
| 20200 | |||
| 20201 | if test $gl_cv_have_include_next = yes; then | ||
| 20202 | gl_cv_next_string_h='<'string.h'>' | ||
| 20203 | else | ||
| 20204 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 | ||
| 20205 | $as_echo_n "checking absolute name of <string.h>... " >&6; } | ||
| 20206 | if test "${gl_cv_next_string_h+set}" = set; then : | ||
| 20207 | $as_echo_n "(cached) " >&6 | ||
| 20208 | else | ||
| 20209 | |||
| 20210 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
| 20211 | /* end confdefs.h. */ | ||
| 20212 | #include <string.h> | ||
| 20213 | |||
| 20214 | _ACEOF | ||
| 20215 | case "$host_os" in | ||
| 20216 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | ||
| 20217 | *) gl_absname_cpp="$ac_cpp" ;; | ||
| 20218 | esac | ||
| 20219 | |||
| 20220 | case "$host_os" in | ||
| 20221 | mingw*) | ||
| 20222 | gl_dirsep_regex='[/\\]' | ||
| 20223 | ;; | ||
| 20224 | *) | ||
| 20225 | gl_dirsep_regex='\/' | ||
| 20226 | ;; | ||
| 20227 | esac | ||
| 20228 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | ||
| 20229 | |||
| 20230 | gl_header_literal_regex=`echo 'string.h' \ | ||
| 20231 | | sed -e "$gl_make_literal_regex_sed"` | ||
| 20232 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | ||
| 20233 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | ||
| 20234 | s|^/[^/]|//&| | ||
| 20235 | p | ||
| 20236 | q | ||
| 20237 | }' | ||
| 20238 | gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | ||
| 20239 | sed -n "$gl_absolute_header_sed"`'"' | ||
| 20240 | |||
| 20241 | |||
| 20242 | fi | ||
| 20243 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 | ||
| 20244 | $as_echo "$gl_cv_next_string_h" >&6; } | ||
| 20245 | fi | ||
| 20246 | NEXT_STRING_H=$gl_cv_next_string_h | ||
| 20247 | |||
| 20248 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | ||
| 20249 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | ||
| 20250 | gl_next_as_first_directive='<'string.h'>' | ||
| 20251 | else | ||
| 20252 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | ||
| 20253 | gl_next_as_first_directive=$gl_cv_next_string_h | ||
| 20254 | fi | ||
| 20255 | NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive | ||
| 20256 | |||
| 20257 | |||
| 20258 | |||
| 20259 | |||
| 20260 | |||
| 20261 | |||
| 20262 | |||
| 20263 | |||
| 20264 | |||
| 20029 | ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" | 20265 | ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" |
| 20030 | if test "x$ac_cv_have_decl_strtoimax" = x""yes; then : | 20266 | if test "x$ac_cv_have_decl_strtoimax" = x""yes; then : |
| 20031 | ac_have_decl=1 | 20267 | ac_have_decl=1 |
| @@ -22352,6 +22588,51 @@ done | |||
| 22352 | 22588 | ||
| 22353 | 22589 | ||
| 22354 | 22590 | ||
| 22591 | if test $ac_cv_have_decl_memrchr = no; then | ||
| 22592 | HAVE_DECL_MEMRCHR=0 | ||
| 22593 | fi | ||
| 22594 | |||
| 22595 | for ac_func in memrchr | ||
| 22596 | do : | ||
| 22597 | ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" | ||
| 22598 | if test "x$ac_cv_func_memrchr" = x""yes; then : | ||
| 22599 | cat >>confdefs.h <<_ACEOF | ||
| 22600 | #define HAVE_MEMRCHR 1 | ||
| 22601 | _ACEOF | ||
| 22602 | |||
| 22603 | fi | ||
| 22604 | done | ||
| 22605 | |||
| 22606 | |||
| 22607 | if test $ac_cv_func_memrchr = no; then | ||
| 22608 | |||
| 22609 | |||
| 22610 | |||
| 22611 | |||
| 22612 | |||
| 22613 | |||
| 22614 | |||
| 22615 | |||
| 22616 | gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext" | ||
| 22617 | |||
| 22618 | : | ||
| 22619 | fi | ||
| 22620 | |||
| 22621 | |||
| 22622 | |||
| 22623 | |||
| 22624 | |||
| 22625 | GNULIB_MEMRCHR=1 | ||
| 22626 | |||
| 22627 | |||
| 22628 | |||
| 22629 | |||
| 22630 | |||
| 22631 | |||
| 22632 | |||
| 22633 | |||
| 22634 | |||
| 22635 | |||
| 22355 | 22636 | ||
| 22356 | if test $APPLE_UNIVERSAL_BUILD = 1; then | 22637 | if test $APPLE_UNIVERSAL_BUILD = 1; then |
| 22357 | # A universal build on Apple Mac OS X platforms. | 22638 | # A universal build on Apple Mac OS X platforms. |
| @@ -24209,6 +24490,9 @@ $as_echo "#define my_strftime nstrftime" >>confdefs.h | |||
| 24209 | 24490 | ||
| 24210 | 24491 | ||
| 24211 | 24492 | ||
| 24493 | |||
| 24494 | |||
| 24495 | |||
| 24212 | if test "$ac_cv_have_decl_strtoimax" != yes; then | 24496 | if test "$ac_cv_have_decl_strtoimax" != yes; then |
| 24213 | HAVE_DECL_STRTOIMAX=0 | 24497 | HAVE_DECL_STRTOIMAX=0 |
| 24214 | fi | 24498 | fi |
diff --git a/configure.ac b/configure.ac index 8dfc5c9ba47..ce96ca042ca 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -35,7 +35,7 @@ for var in CFLAGS CPPFLAGS LDFLAGS; do | |||
| 35 | esac | 35 | esac |
| 36 | eval val="\$${var}" | 36 | eval val="\$${var}" |
| 37 | test x"$val" = x && continue | 37 | test x"$val" = x && continue |
| 38 | emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=$val" | 38 | emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\"" |
| 39 | done | 39 | done |
| 40 | 40 | ||
| 41 | AC_CONFIG_HEADER(src/config.h:src/config.in) | 41 | AC_CONFIG_HEADER(src/config.h:src/config.in) |
| @@ -76,6 +76,9 @@ of the buffer is visible). | |||
| 76 | ** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized', | 76 | ** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized', |
| 77 | bound to <f11> and M-<f10>, respectively. | 77 | bound to <f11> and M-<f10>, respectively. |
| 78 | 78 | ||
| 79 | ** In keymaps where SPC scrolls, S-SPC now scrolls in the reverse direction. | ||
| 80 | Eg View mode, etc. | ||
| 81 | |||
| 79 | 82 | ||
| 80 | * Changes in Specialized Modes and Packages in Emacs 24.4 | 83 | * Changes in Specialized Modes and Packages in Emacs 24.4 |
| 81 | 84 | ||
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 8103eec88a0..c130cbc65b8 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings | 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
| @@ -480,6 +480,15 @@ EXTRA_libgnu_a_SOURCES += lstat.c | |||
| 480 | 480 | ||
| 481 | ## end gnulib module lstat | 481 | ## end gnulib module lstat |
| 482 | 482 | ||
| 483 | ## begin gnulib module memrchr | ||
| 484 | |||
| 485 | |||
| 486 | EXTRA_DIST += memrchr.c | ||
| 487 | |||
| 488 | EXTRA_libgnu_a_SOURCES += memrchr.c | ||
| 489 | |||
| 490 | ## end gnulib module memrchr | ||
| 491 | |||
| 483 | ## begin gnulib module mktime | 492 | ## begin gnulib module mktime |
| 484 | 493 | ||
| 485 | 494 | ||
| @@ -1105,6 +1114,106 @@ EXTRA_DIST += strftime.h | |||
| 1105 | 1114 | ||
| 1106 | ## end gnulib module strftime | 1115 | ## end gnulib module strftime |
| 1107 | 1116 | ||
| 1117 | ## begin gnulib module string | ||
| 1118 | |||
| 1119 | BUILT_SOURCES += string.h | ||
| 1120 | |||
| 1121 | # We need the following in order to create <string.h> when the system | ||
| 1122 | # doesn't have one that works with the given compiler. | ||
| 1123 | string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) | ||
| 1124 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 1125 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
| 1126 | sed -e 's|@''GUARD_PREFIX''@|GL|g' \ | ||
| 1127 | -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ | ||
| 1128 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | ||
| 1129 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | ||
| 1130 | -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ | ||
| 1131 | -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ | ||
| 1132 | -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ | ||
| 1133 | -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ | ||
| 1134 | -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ | ||
| 1135 | -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ | ||
| 1136 | -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ | ||
| 1137 | -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ | ||
| 1138 | -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ | ||
| 1139 | -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ | ||
| 1140 | -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ | ||
| 1141 | -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ | ||
| 1142 | -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ | ||
| 1143 | -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ | ||
| 1144 | -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ | ||
| 1145 | -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ | ||
| 1146 | -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ | ||
| 1147 | -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ | ||
| 1148 | -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ | ||
| 1149 | -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ | ||
| 1150 | -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ | ||
| 1151 | -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ | ||
| 1152 | -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ | ||
| 1153 | -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ | ||
| 1154 | -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ | ||
| 1155 | -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ | ||
| 1156 | -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ | ||
| 1157 | -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ | ||
| 1158 | -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ | ||
| 1159 | -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ | ||
| 1160 | -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ | ||
| 1161 | -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ | ||
| 1162 | -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ | ||
| 1163 | -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ | ||
| 1164 | -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ | ||
| 1165 | -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ | ||
| 1166 | -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ | ||
| 1167 | -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ | ||
| 1168 | < $(srcdir)/string.in.h | \ | ||
| 1169 | sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ | ||
| 1170 | -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ | ||
| 1171 | -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ | ||
| 1172 | -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ | ||
| 1173 | -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ | ||
| 1174 | -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ | ||
| 1175 | -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ | ||
| 1176 | -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ | ||
| 1177 | -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ | ||
| 1178 | -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ | ||
| 1179 | -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ | ||
| 1180 | -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ | ||
| 1181 | -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ | ||
| 1182 | -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ | ||
| 1183 | -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ | ||
| 1184 | -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ | ||
| 1185 | -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ | ||
| 1186 | -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ | ||
| 1187 | -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ | ||
| 1188 | -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ | ||
| 1189 | -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ | ||
| 1190 | -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ | ||
| 1191 | -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ | ||
| 1192 | -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ | ||
| 1193 | -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ | ||
| 1194 | -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ | ||
| 1195 | -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ | ||
| 1196 | -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ | ||
| 1197 | -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ | ||
| 1198 | -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ | ||
| 1199 | -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ | ||
| 1200 | -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ | ||
| 1201 | -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ | ||
| 1202 | -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ | ||
| 1203 | -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ | ||
| 1204 | -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ | ||
| 1205 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ | ||
| 1206 | -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ | ||
| 1207 | -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ | ||
| 1208 | < $(srcdir)/string.in.h; \ | ||
| 1209 | } > $@-t && \ | ||
| 1210 | mv $@-t $@ | ||
| 1211 | MOSTLYCLEANFILES += string.h string.h-t | ||
| 1212 | |||
| 1213 | EXTRA_DIST += string.in.h | ||
| 1214 | |||
| 1215 | ## end gnulib module string | ||
| 1216 | |||
| 1108 | ## begin gnulib module strtoimax | 1217 | ## begin gnulib module strtoimax |
| 1109 | 1218 | ||
| 1110 | 1219 | ||
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index d5128cc9a61..cd62fbcd13d 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in | |||
| @@ -34,6 +34,7 @@ GNULIBOBJS = $(BLD)/c-ctype.$(O) \ | |||
| 34 | $(BLD)/getopt.$(O) \ | 34 | $(BLD)/getopt.$(O) \ |
| 35 | $(BLD)/getopt1.$(O) \ | 35 | $(BLD)/getopt1.$(O) \ |
| 36 | $(BLD)/gettime.$(O) \ | 36 | $(BLD)/gettime.$(O) \ |
| 37 | $(BLD)/memrchr.$(O) \ | ||
| 37 | $(BLD)/strftime.$(O) \ | 38 | $(BLD)/strftime.$(O) \ |
| 38 | $(BLD)/time_r.$(O) \ | 39 | $(BLD)/time_r.$(O) \ |
| 39 | $(BLD)/timespec-add.$(O) \ | 40 | $(BLD)/timespec-add.$(O) \ |
| @@ -201,6 +202,10 @@ $(BLD)/md5.$(O) : \ | |||
| 201 | $(CONFIG_H) \ | 202 | $(CONFIG_H) \ |
| 202 | $(MD5_H) | 203 | $(MD5_H) |
| 203 | 204 | ||
| 205 | $(BLD)/memrchr.$(O) : \ | ||
| 206 | $(GNU_LIB)/memrchr.c \ | ||
| 207 | $(CONFIG_H) | ||
| 208 | |||
| 204 | $(BLD)/sha1.$(O) : \ | 209 | $(BLD)/sha1.$(O) : \ |
| 205 | $(GNU_LIB)/sha1.c \ | 210 | $(GNU_LIB)/sha1.c \ |
| 206 | $(NT_INC)/stdalign.h \ | 211 | $(NT_INC)/stdalign.h \ |
diff --git a/lib/memrchr.c b/lib/memrchr.c new file mode 100644 index 00000000000..5a023e0638a --- /dev/null +++ b/lib/memrchr.c | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | /* memrchr -- find the last occurrence of a byte in a memory block | ||
| 2 | |||
| 3 | Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2013 Free Software | ||
| 4 | Foundation, Inc. | ||
| 5 | |||
| 6 | Based on strlen implementation by Torbjorn Granlund (tege@sics.se), | ||
| 7 | with help from Dan Sahlin (dan@sics.se) and | ||
| 8 | commentary by Jim Blandy (jimb@ai.mit.edu); | ||
| 9 | adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), | ||
| 10 | and implemented by Roland McGrath (roland@ai.mit.edu). | ||
| 11 | |||
| 12 | This program is free software: you can redistribute it and/or modify | ||
| 13 | it under the terms of the GNU General Public License as published by | ||
| 14 | the Free Software Foundation; either version 3 of the License, or | ||
| 15 | (at your option) any later version. | ||
| 16 | |||
| 17 | This program is distributed in the hope that it will be useful, | ||
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | GNU General Public License for more details. | ||
| 21 | |||
| 22 | You should have received a copy of the GNU General Public License | ||
| 23 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 24 | |||
| 25 | #if defined _LIBC | ||
| 26 | # include <memcopy.h> | ||
| 27 | #else | ||
| 28 | # include <config.h> | ||
| 29 | # define reg_char char | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #include <string.h> | ||
| 33 | #include <limits.h> | ||
| 34 | |||
| 35 | #undef __memrchr | ||
| 36 | #ifdef _LIBC | ||
| 37 | # undef memrchr | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #ifndef weak_alias | ||
| 41 | # define __memrchr memrchr | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /* Search no more than N bytes of S for C. */ | ||
| 45 | void * | ||
| 46 | __memrchr (void const *s, int c_in, size_t n) | ||
| 47 | { | ||
| 48 | /* On 32-bit hardware, choosing longword to be a 32-bit unsigned | ||
| 49 | long instead of a 64-bit uintmax_t tends to give better | ||
| 50 | performance. On 64-bit hardware, unsigned long is generally 64 | ||
| 51 | bits already. Change this typedef to experiment with | ||
| 52 | performance. */ | ||
| 53 | typedef unsigned long int longword; | ||
| 54 | |||
| 55 | const unsigned char *char_ptr; | ||
| 56 | const longword *longword_ptr; | ||
| 57 | longword repeated_one; | ||
| 58 | longword repeated_c; | ||
| 59 | unsigned reg_char c; | ||
| 60 | |||
| 61 | c = (unsigned char) c_in; | ||
| 62 | |||
| 63 | /* Handle the last few bytes by reading one byte at a time. | ||
| 64 | Do this until CHAR_PTR is aligned on a longword boundary. */ | ||
| 65 | for (char_ptr = (const unsigned char *) s + n; | ||
| 66 | n > 0 && (size_t) char_ptr % sizeof (longword) != 0; | ||
| 67 | --n) | ||
| 68 | if (*--char_ptr == c) | ||
| 69 | return (void *) char_ptr; | ||
| 70 | |||
| 71 | longword_ptr = (const longword *) char_ptr; | ||
| 72 | |||
| 73 | /* All these elucidatory comments refer to 4-byte longwords, | ||
| 74 | but the theory applies equally well to any size longwords. */ | ||
| 75 | |||
| 76 | /* Compute auxiliary longword values: | ||
| 77 | repeated_one is a value which has a 1 in every byte. | ||
| 78 | repeated_c has c in every byte. */ | ||
| 79 | repeated_one = 0x01010101; | ||
| 80 | repeated_c = c | (c << 8); | ||
| 81 | repeated_c |= repeated_c << 16; | ||
| 82 | if (0xffffffffU < (longword) -1) | ||
| 83 | { | ||
| 84 | repeated_one |= repeated_one << 31 << 1; | ||
| 85 | repeated_c |= repeated_c << 31 << 1; | ||
| 86 | if (8 < sizeof (longword)) | ||
| 87 | { | ||
| 88 | size_t i; | ||
| 89 | |||
| 90 | for (i = 64; i < sizeof (longword) * 8; i *= 2) | ||
| 91 | { | ||
| 92 | repeated_one |= repeated_one << i; | ||
| 93 | repeated_c |= repeated_c << i; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | /* Instead of the traditional loop which tests each byte, we will test a | ||
| 99 | longword at a time. The tricky part is testing if *any of the four* | ||
| 100 | bytes in the longword in question are equal to c. We first use an xor | ||
| 101 | with repeated_c. This reduces the task to testing whether *any of the | ||
| 102 | four* bytes in longword1 is zero. | ||
| 103 | |||
| 104 | We compute tmp = | ||
| 105 | ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). | ||
| 106 | That is, we perform the following operations: | ||
| 107 | 1. Subtract repeated_one. | ||
| 108 | 2. & ~longword1. | ||
| 109 | 3. & a mask consisting of 0x80 in every byte. | ||
| 110 | Consider what happens in each byte: | ||
| 111 | - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, | ||
| 112 | and step 3 transforms it into 0x80. A carry can also be propagated | ||
| 113 | to more significant bytes. | ||
| 114 | - If a byte of longword1 is nonzero, let its lowest 1 bit be at | ||
| 115 | position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, | ||
| 116 | the byte ends in a single bit of value 0 and k bits of value 1. | ||
| 117 | After step 2, the result is just k bits of value 1: 2^k - 1. After | ||
| 118 | step 3, the result is 0. And no carry is produced. | ||
| 119 | So, if longword1 has only non-zero bytes, tmp is zero. | ||
| 120 | Whereas if longword1 has a zero byte, call j the position of the least | ||
| 121 | significant zero byte. Then the result has a zero at positions 0, ..., | ||
| 122 | j-1 and a 0x80 at position j. We cannot predict the result at the more | ||
| 123 | significant bytes (positions j+1..3), but it does not matter since we | ||
| 124 | already have a non-zero bit at position 8*j+7. | ||
| 125 | |||
| 126 | So, the test whether any byte in longword1 is zero is equivalent to | ||
| 127 | testing whether tmp is nonzero. */ | ||
| 128 | |||
| 129 | while (n >= sizeof (longword)) | ||
| 130 | { | ||
| 131 | longword longword1 = *--longword_ptr ^ repeated_c; | ||
| 132 | |||
| 133 | if ((((longword1 - repeated_one) & ~longword1) | ||
| 134 | & (repeated_one << 7)) != 0) | ||
| 135 | { | ||
| 136 | longword_ptr++; | ||
| 137 | break; | ||
| 138 | } | ||
| 139 | n -= sizeof (longword); | ||
| 140 | } | ||
| 141 | |||
| 142 | char_ptr = (const unsigned char *) longword_ptr; | ||
| 143 | |||
| 144 | /* At this point, we know that either n < sizeof (longword), or one of the | ||
| 145 | sizeof (longword) bytes starting at char_ptr is == c. On little-endian | ||
| 146 | machines, we could determine the first such byte without any further | ||
| 147 | memory accesses, just by looking at the tmp result from the last loop | ||
| 148 | iteration. But this does not work on big-endian machines. Choose code | ||
| 149 | that works in both cases. */ | ||
| 150 | |||
| 151 | while (n-- > 0) | ||
| 152 | { | ||
| 153 | if (*--char_ptr == c) | ||
| 154 | return (void *) char_ptr; | ||
| 155 | } | ||
| 156 | |||
| 157 | return NULL; | ||
| 158 | } | ||
| 159 | #ifdef weak_alias | ||
| 160 | weak_alias (__memrchr, memrchr) | ||
| 161 | #endif | ||
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index e054c520ebe..c9552480e5d 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h | |||
| @@ -773,7 +773,7 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " | |||
| 773 | _GL_FUNCDECL_SYS (secure_getenv, char *, | 773 | _GL_FUNCDECL_SYS (secure_getenv, char *, |
| 774 | (char const *name) _GL_ARG_NONNULL ((1))); | 774 | (char const *name) _GL_ARG_NONNULL ((1))); |
| 775 | # endif | 775 | # endif |
| 776 | _GL_CXXALIAS_SYS (secure_getenv, int, (char const *name)); | 776 | _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); |
| 777 | _GL_CXXALIASWARN (secure_getenv); | 777 | _GL_CXXALIASWARN (secure_getenv); |
| 778 | #elif defined GNULIB_POSIXCHECK | 778 | #elif defined GNULIB_POSIXCHECK |
| 779 | # undef secure_getenv | 779 | # undef secure_getenv |
diff --git a/lib/string.in.h b/lib/string.in.h new file mode 100644 index 00000000000..d7a6c9c923e --- /dev/null +++ b/lib/string.in.h | |||
| @@ -0,0 +1,1029 @@ | |||
| 1 | /* A GNU-like <string.h>. | ||
| 2 | |||
| 3 | Copyright (C) 1995-1996, 2001-2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation; either version 3, or (at your option) | ||
| 8 | any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | ||
| 17 | |||
| 18 | #ifndef _@GUARD_PREFIX@_STRING_H | ||
| 19 | |||
| 20 | #if __GNUC__ >= 3 | ||
| 21 | @PRAGMA_SYSTEM_HEADER@ | ||
| 22 | #endif | ||
| 23 | @PRAGMA_COLUMNS@ | ||
| 24 | |||
| 25 | /* The include_next requires a split double-inclusion guard. */ | ||
| 26 | #@INCLUDE_NEXT@ @NEXT_STRING_H@ | ||
| 27 | |||
| 28 | #ifndef _@GUARD_PREFIX@_STRING_H | ||
| 29 | #define _@GUARD_PREFIX@_STRING_H | ||
| 30 | |||
| 31 | /* NetBSD 5.0 mis-defines NULL. */ | ||
| 32 | #include <stddef.h> | ||
| 33 | |||
| 34 | /* MirBSD defines mbslen as a macro. */ | ||
| 35 | #if @GNULIB_MBSLEN@ && defined __MirBSD__ | ||
| 36 | # include <wchar.h> | ||
| 37 | #endif | ||
| 38 | |||
| 39 | /* The __attribute__ feature is available in gcc versions 2.5 and later. | ||
| 40 | The attribute __pure__ was added in gcc 2.96. */ | ||
| 41 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | ||
| 42 | # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) | ||
| 43 | #else | ||
| 44 | # define _GL_ATTRIBUTE_PURE /* empty */ | ||
| 45 | #endif | ||
| 46 | |||
| 47 | /* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */ | ||
| 48 | /* But in any case avoid namespace pollution on glibc systems. */ | ||
| 49 | #if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \ | ||
| 50 | && ! defined __GLIBC__ | ||
| 51 | # include <unistd.h> | ||
| 52 | #endif | ||
| 53 | |||
| 54 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ | ||
| 55 | |||
| 56 | /* The definition of _GL_ARG_NONNULL is copied here. */ | ||
| 57 | |||
| 58 | /* The definition of _GL_WARN_ON_USE is copied here. */ | ||
| 59 | |||
| 60 | |||
| 61 | /* Find the index of the least-significant set bit. */ | ||
| 62 | #if @GNULIB_FFSL@ | ||
| 63 | # if !@HAVE_FFSL@ | ||
| 64 | _GL_FUNCDECL_SYS (ffsl, int, (long int i)); | ||
| 65 | # endif | ||
| 66 | _GL_CXXALIAS_SYS (ffsl, int, (long int i)); | ||
| 67 | _GL_CXXALIASWARN (ffsl); | ||
| 68 | #elif defined GNULIB_POSIXCHECK | ||
| 69 | # undef ffsl | ||
| 70 | # if HAVE_RAW_DECL_FFSL | ||
| 71 | _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); | ||
| 72 | # endif | ||
| 73 | #endif | ||
| 74 | |||
| 75 | |||
| 76 | /* Find the index of the least-significant set bit. */ | ||
| 77 | #if @GNULIB_FFSLL@ | ||
| 78 | # if !@HAVE_FFSLL@ | ||
| 79 | _GL_FUNCDECL_SYS (ffsll, int, (long long int i)); | ||
| 80 | # endif | ||
| 81 | _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); | ||
| 82 | _GL_CXXALIASWARN (ffsll); | ||
| 83 | #elif defined GNULIB_POSIXCHECK | ||
| 84 | # undef ffsll | ||
| 85 | # if HAVE_RAW_DECL_FFSLL | ||
| 86 | _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module"); | ||
| 87 | # endif | ||
| 88 | #endif | ||
| 89 | |||
| 90 | |||
| 91 | /* Return the first instance of C within N bytes of S, or NULL. */ | ||
| 92 | #if @GNULIB_MEMCHR@ | ||
| 93 | # if @REPLACE_MEMCHR@ | ||
| 94 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 95 | # define memchr rpl_memchr | ||
| 96 | # endif | ||
| 97 | _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) | ||
| 98 | _GL_ATTRIBUTE_PURE | ||
| 99 | _GL_ARG_NONNULL ((1))); | ||
| 100 | _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); | ||
| 101 | # else | ||
| 102 | # if ! @HAVE_MEMCHR@ | ||
| 103 | _GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) | ||
| 104 | _GL_ATTRIBUTE_PURE | ||
| 105 | _GL_ARG_NONNULL ((1))); | ||
| 106 | # endif | ||
| 107 | /* On some systems, this function is defined as an overloaded function: | ||
| 108 | extern "C" { const void * std::memchr (const void *, int, size_t); } | ||
| 109 | extern "C++" { void * std::memchr (void *, int, size_t); } */ | ||
| 110 | _GL_CXXALIAS_SYS_CAST2 (memchr, | ||
| 111 | void *, (void const *__s, int __c, size_t __n), | ||
| 112 | void const *, (void const *__s, int __c, size_t __n)); | ||
| 113 | # endif | ||
| 114 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 115 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 116 | _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n)); | ||
| 117 | _GL_CXXALIASWARN1 (memchr, void const *, | ||
| 118 | (void const *__s, int __c, size_t __n)); | ||
| 119 | # else | ||
| 120 | _GL_CXXALIASWARN (memchr); | ||
| 121 | # endif | ||
| 122 | #elif defined GNULIB_POSIXCHECK | ||
| 123 | # undef memchr | ||
| 124 | /* Assume memchr is always declared. */ | ||
| 125 | _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - " | ||
| 126 | "use gnulib module memchr for portability" ); | ||
| 127 | #endif | ||
| 128 | |||
| 129 | /* Return the first occurrence of NEEDLE in HAYSTACK. */ | ||
| 130 | #if @GNULIB_MEMMEM@ | ||
| 131 | # if @REPLACE_MEMMEM@ | ||
| 132 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 133 | # define memmem rpl_memmem | ||
| 134 | # endif | ||
| 135 | _GL_FUNCDECL_RPL (memmem, void *, | ||
| 136 | (void const *__haystack, size_t __haystack_len, | ||
| 137 | void const *__needle, size_t __needle_len) | ||
| 138 | _GL_ATTRIBUTE_PURE | ||
| 139 | _GL_ARG_NONNULL ((1, 3))); | ||
| 140 | _GL_CXXALIAS_RPL (memmem, void *, | ||
| 141 | (void const *__haystack, size_t __haystack_len, | ||
| 142 | void const *__needle, size_t __needle_len)); | ||
| 143 | # else | ||
| 144 | # if ! @HAVE_DECL_MEMMEM@ | ||
| 145 | _GL_FUNCDECL_SYS (memmem, void *, | ||
| 146 | (void const *__haystack, size_t __haystack_len, | ||
| 147 | void const *__needle, size_t __needle_len) | ||
| 148 | _GL_ATTRIBUTE_PURE | ||
| 149 | _GL_ARG_NONNULL ((1, 3))); | ||
| 150 | # endif | ||
| 151 | _GL_CXXALIAS_SYS (memmem, void *, | ||
| 152 | (void const *__haystack, size_t __haystack_len, | ||
| 153 | void const *__needle, size_t __needle_len)); | ||
| 154 | # endif | ||
| 155 | _GL_CXXALIASWARN (memmem); | ||
| 156 | #elif defined GNULIB_POSIXCHECK | ||
| 157 | # undef memmem | ||
| 158 | # if HAVE_RAW_DECL_MEMMEM | ||
| 159 | _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - " | ||
| 160 | "use gnulib module memmem-simple for portability, " | ||
| 161 | "and module memmem for speed" ); | ||
| 162 | # endif | ||
| 163 | #endif | ||
| 164 | |||
| 165 | /* Copy N bytes of SRC to DEST, return pointer to bytes after the | ||
| 166 | last written byte. */ | ||
| 167 | #if @GNULIB_MEMPCPY@ | ||
| 168 | # if ! @HAVE_MEMPCPY@ | ||
| 169 | _GL_FUNCDECL_SYS (mempcpy, void *, | ||
| 170 | (void *restrict __dest, void const *restrict __src, | ||
| 171 | size_t __n) | ||
| 172 | _GL_ARG_NONNULL ((1, 2))); | ||
| 173 | # endif | ||
| 174 | _GL_CXXALIAS_SYS (mempcpy, void *, | ||
| 175 | (void *restrict __dest, void const *restrict __src, | ||
| 176 | size_t __n)); | ||
| 177 | _GL_CXXALIASWARN (mempcpy); | ||
| 178 | #elif defined GNULIB_POSIXCHECK | ||
| 179 | # undef mempcpy | ||
| 180 | # if HAVE_RAW_DECL_MEMPCPY | ||
| 181 | _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " | ||
| 182 | "use gnulib module mempcpy for portability"); | ||
| 183 | # endif | ||
| 184 | #endif | ||
| 185 | |||
| 186 | /* Search backwards through a block for a byte (specified as an int). */ | ||
| 187 | #if @GNULIB_MEMRCHR@ | ||
| 188 | # if ! @HAVE_DECL_MEMRCHR@ | ||
| 189 | _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) | ||
| 190 | _GL_ATTRIBUTE_PURE | ||
| 191 | _GL_ARG_NONNULL ((1))); | ||
| 192 | # endif | ||
| 193 | /* On some systems, this function is defined as an overloaded function: | ||
| 194 | extern "C++" { const void * std::memrchr (const void *, int, size_t); } | ||
| 195 | extern "C++" { void * std::memrchr (void *, int, size_t); } */ | ||
| 196 | _GL_CXXALIAS_SYS_CAST2 (memrchr, | ||
| 197 | void *, (void const *, int, size_t), | ||
| 198 | void const *, (void const *, int, size_t)); | ||
| 199 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 200 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 201 | _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t)); | ||
| 202 | _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t)); | ||
| 203 | # else | ||
| 204 | _GL_CXXALIASWARN (memrchr); | ||
| 205 | # endif | ||
| 206 | #elif defined GNULIB_POSIXCHECK | ||
| 207 | # undef memrchr | ||
| 208 | # if HAVE_RAW_DECL_MEMRCHR | ||
| 209 | _GL_WARN_ON_USE (memrchr, "memrchr is unportable - " | ||
| 210 | "use gnulib module memrchr for portability"); | ||
| 211 | # endif | ||
| 212 | #endif | ||
| 213 | |||
| 214 | /* Find the first occurrence of C in S. More efficient than | ||
| 215 | memchr(S,C,N), at the expense of undefined behavior if C does not | ||
| 216 | occur within N bytes. */ | ||
| 217 | #if @GNULIB_RAWMEMCHR@ | ||
| 218 | # if ! @HAVE_RAWMEMCHR@ | ||
| 219 | _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) | ||
| 220 | _GL_ATTRIBUTE_PURE | ||
| 221 | _GL_ARG_NONNULL ((1))); | ||
| 222 | # endif | ||
| 223 | /* On some systems, this function is defined as an overloaded function: | ||
| 224 | extern "C++" { const void * std::rawmemchr (const void *, int); } | ||
| 225 | extern "C++" { void * std::rawmemchr (void *, int); } */ | ||
| 226 | _GL_CXXALIAS_SYS_CAST2 (rawmemchr, | ||
| 227 | void *, (void const *__s, int __c_in), | ||
| 228 | void const *, (void const *__s, int __c_in)); | ||
| 229 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 230 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 231 | _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in)); | ||
| 232 | _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in)); | ||
| 233 | # else | ||
| 234 | _GL_CXXALIASWARN (rawmemchr); | ||
| 235 | # endif | ||
| 236 | #elif defined GNULIB_POSIXCHECK | ||
| 237 | # undef rawmemchr | ||
| 238 | # if HAVE_RAW_DECL_RAWMEMCHR | ||
| 239 | _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - " | ||
| 240 | "use gnulib module rawmemchr for portability"); | ||
| 241 | # endif | ||
| 242 | #endif | ||
| 243 | |||
| 244 | /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ | ||
| 245 | #if @GNULIB_STPCPY@ | ||
| 246 | # if ! @HAVE_STPCPY@ | ||
| 247 | _GL_FUNCDECL_SYS (stpcpy, char *, | ||
| 248 | (char *restrict __dst, char const *restrict __src) | ||
| 249 | _GL_ARG_NONNULL ((1, 2))); | ||
| 250 | # endif | ||
| 251 | _GL_CXXALIAS_SYS (stpcpy, char *, | ||
| 252 | (char *restrict __dst, char const *restrict __src)); | ||
| 253 | _GL_CXXALIASWARN (stpcpy); | ||
| 254 | #elif defined GNULIB_POSIXCHECK | ||
| 255 | # undef stpcpy | ||
| 256 | # if HAVE_RAW_DECL_STPCPY | ||
| 257 | _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - " | ||
| 258 | "use gnulib module stpcpy for portability"); | ||
| 259 | # endif | ||
| 260 | #endif | ||
| 261 | |||
| 262 | /* Copy no more than N bytes of SRC to DST, returning a pointer past the | ||
| 263 | last non-NUL byte written into DST. */ | ||
| 264 | #if @GNULIB_STPNCPY@ | ||
| 265 | # if @REPLACE_STPNCPY@ | ||
| 266 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 267 | # undef stpncpy | ||
| 268 | # define stpncpy rpl_stpncpy | ||
| 269 | # endif | ||
| 270 | _GL_FUNCDECL_RPL (stpncpy, char *, | ||
| 271 | (char *restrict __dst, char const *restrict __src, | ||
| 272 | size_t __n) | ||
| 273 | _GL_ARG_NONNULL ((1, 2))); | ||
| 274 | _GL_CXXALIAS_RPL (stpncpy, char *, | ||
| 275 | (char *restrict __dst, char const *restrict __src, | ||
| 276 | size_t __n)); | ||
| 277 | # else | ||
| 278 | # if ! @HAVE_STPNCPY@ | ||
| 279 | _GL_FUNCDECL_SYS (stpncpy, char *, | ||
| 280 | (char *restrict __dst, char const *restrict __src, | ||
| 281 | size_t __n) | ||
| 282 | _GL_ARG_NONNULL ((1, 2))); | ||
| 283 | # endif | ||
| 284 | _GL_CXXALIAS_SYS (stpncpy, char *, | ||
| 285 | (char *restrict __dst, char const *restrict __src, | ||
| 286 | size_t __n)); | ||
| 287 | # endif | ||
| 288 | _GL_CXXALIASWARN (stpncpy); | ||
| 289 | #elif defined GNULIB_POSIXCHECK | ||
| 290 | # undef stpncpy | ||
| 291 | # if HAVE_RAW_DECL_STPNCPY | ||
| 292 | _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " | ||
| 293 | "use gnulib module stpncpy for portability"); | ||
| 294 | # endif | ||
| 295 | #endif | ||
| 296 | |||
| 297 | #if defined GNULIB_POSIXCHECK | ||
| 298 | /* strchr() does not work with multibyte strings if the locale encoding is | ||
| 299 | GB18030 and the character to be searched is a digit. */ | ||
| 300 | # undef strchr | ||
| 301 | /* Assume strchr is always declared. */ | ||
| 302 | _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings " | ||
| 303 | "in some multibyte locales - " | ||
| 304 | "use mbschr if you care about internationalization"); | ||
| 305 | #endif | ||
| 306 | |||
| 307 | /* Find the first occurrence of C in S or the final NUL byte. */ | ||
| 308 | #if @GNULIB_STRCHRNUL@ | ||
| 309 | # if @REPLACE_STRCHRNUL@ | ||
| 310 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 311 | # define strchrnul rpl_strchrnul | ||
| 312 | # endif | ||
| 313 | _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in) | ||
| 314 | _GL_ATTRIBUTE_PURE | ||
| 315 | _GL_ARG_NONNULL ((1))); | ||
| 316 | _GL_CXXALIAS_RPL (strchrnul, char *, | ||
| 317 | (const char *str, int ch)); | ||
| 318 | # else | ||
| 319 | # if ! @HAVE_STRCHRNUL@ | ||
| 320 | _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) | ||
| 321 | _GL_ATTRIBUTE_PURE | ||
| 322 | _GL_ARG_NONNULL ((1))); | ||
| 323 | # endif | ||
| 324 | /* On some systems, this function is defined as an overloaded function: | ||
| 325 | extern "C++" { const char * std::strchrnul (const char *, int); } | ||
| 326 | extern "C++" { char * std::strchrnul (char *, int); } */ | ||
| 327 | _GL_CXXALIAS_SYS_CAST2 (strchrnul, | ||
| 328 | char *, (char const *__s, int __c_in), | ||
| 329 | char const *, (char const *__s, int __c_in)); | ||
| 330 | # endif | ||
| 331 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 332 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 333 | _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in)); | ||
| 334 | _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in)); | ||
| 335 | # else | ||
| 336 | _GL_CXXALIASWARN (strchrnul); | ||
| 337 | # endif | ||
| 338 | #elif defined GNULIB_POSIXCHECK | ||
| 339 | # undef strchrnul | ||
| 340 | # if HAVE_RAW_DECL_STRCHRNUL | ||
| 341 | _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " | ||
| 342 | "use gnulib module strchrnul for portability"); | ||
| 343 | # endif | ||
| 344 | #endif | ||
| 345 | |||
| 346 | /* Duplicate S, returning an identical malloc'd string. */ | ||
| 347 | #if @GNULIB_STRDUP@ | ||
| 348 | # if @REPLACE_STRDUP@ | ||
| 349 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 350 | # undef strdup | ||
| 351 | # define strdup rpl_strdup | ||
| 352 | # endif | ||
| 353 | _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); | ||
| 354 | _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); | ||
| 355 | # else | ||
| 356 | # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup | ||
| 357 | /* strdup exists as a function and as a macro. Get rid of the macro. */ | ||
| 358 | # undef strdup | ||
| 359 | # endif | ||
| 360 | # if !(@HAVE_DECL_STRDUP@ || defined strdup) | ||
| 361 | _GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); | ||
| 362 | # endif | ||
| 363 | _GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); | ||
| 364 | # endif | ||
| 365 | _GL_CXXALIASWARN (strdup); | ||
| 366 | #elif defined GNULIB_POSIXCHECK | ||
| 367 | # undef strdup | ||
| 368 | # if HAVE_RAW_DECL_STRDUP | ||
| 369 | _GL_WARN_ON_USE (strdup, "strdup is unportable - " | ||
| 370 | "use gnulib module strdup for portability"); | ||
| 371 | # endif | ||
| 372 | #endif | ||
| 373 | |||
| 374 | /* Append no more than N characters from SRC onto DEST. */ | ||
| 375 | #if @GNULIB_STRNCAT@ | ||
| 376 | # if @REPLACE_STRNCAT@ | ||
| 377 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 378 | # undef strncat | ||
| 379 | # define strncat rpl_strncat | ||
| 380 | # endif | ||
| 381 | _GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) | ||
| 382 | _GL_ARG_NONNULL ((1, 2))); | ||
| 383 | _GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); | ||
| 384 | # else | ||
| 385 | _GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); | ||
| 386 | # endif | ||
| 387 | _GL_CXXALIASWARN (strncat); | ||
| 388 | #elif defined GNULIB_POSIXCHECK | ||
| 389 | # undef strncat | ||
| 390 | # if HAVE_RAW_DECL_STRNCAT | ||
| 391 | _GL_WARN_ON_USE (strncat, "strncat is unportable - " | ||
| 392 | "use gnulib module strncat for portability"); | ||
| 393 | # endif | ||
| 394 | #endif | ||
| 395 | |||
| 396 | /* Return a newly allocated copy of at most N bytes of STRING. */ | ||
| 397 | #if @GNULIB_STRNDUP@ | ||
| 398 | # if @REPLACE_STRNDUP@ | ||
| 399 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 400 | # undef strndup | ||
| 401 | # define strndup rpl_strndup | ||
| 402 | # endif | ||
| 403 | _GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n) | ||
| 404 | _GL_ARG_NONNULL ((1))); | ||
| 405 | _GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n)); | ||
| 406 | # else | ||
| 407 | # if ! @HAVE_DECL_STRNDUP@ | ||
| 408 | _GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n) | ||
| 409 | _GL_ARG_NONNULL ((1))); | ||
| 410 | # endif | ||
| 411 | _GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n)); | ||
| 412 | # endif | ||
| 413 | _GL_CXXALIASWARN (strndup); | ||
| 414 | #elif defined GNULIB_POSIXCHECK | ||
| 415 | # undef strndup | ||
| 416 | # if HAVE_RAW_DECL_STRNDUP | ||
| 417 | _GL_WARN_ON_USE (strndup, "strndup is unportable - " | ||
| 418 | "use gnulib module strndup for portability"); | ||
| 419 | # endif | ||
| 420 | #endif | ||
| 421 | |||
| 422 | /* Find the length (number of bytes) of STRING, but scan at most | ||
| 423 | MAXLEN bytes. If no '\0' terminator is found in that many bytes, | ||
| 424 | return MAXLEN. */ | ||
| 425 | #if @GNULIB_STRNLEN@ | ||
| 426 | # if @REPLACE_STRNLEN@ | ||
| 427 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 428 | # undef strnlen | ||
| 429 | # define strnlen rpl_strnlen | ||
| 430 | # endif | ||
| 431 | _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen) | ||
| 432 | _GL_ATTRIBUTE_PURE | ||
| 433 | _GL_ARG_NONNULL ((1))); | ||
| 434 | _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)); | ||
| 435 | # else | ||
| 436 | # if ! @HAVE_DECL_STRNLEN@ | ||
| 437 | _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen) | ||
| 438 | _GL_ATTRIBUTE_PURE | ||
| 439 | _GL_ARG_NONNULL ((1))); | ||
| 440 | # endif | ||
| 441 | _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)); | ||
| 442 | # endif | ||
| 443 | _GL_CXXALIASWARN (strnlen); | ||
| 444 | #elif defined GNULIB_POSIXCHECK | ||
| 445 | # undef strnlen | ||
| 446 | # if HAVE_RAW_DECL_STRNLEN | ||
| 447 | _GL_WARN_ON_USE (strnlen, "strnlen is unportable - " | ||
| 448 | "use gnulib module strnlen for portability"); | ||
| 449 | # endif | ||
| 450 | #endif | ||
| 451 | |||
| 452 | #if defined GNULIB_POSIXCHECK | ||
| 453 | /* strcspn() assumes the second argument is a list of single-byte characters. | ||
| 454 | Even in this simple case, it does not work with multibyte strings if the | ||
| 455 | locale encoding is GB18030 and one of the characters to be searched is a | ||
| 456 | digit. */ | ||
| 457 | # undef strcspn | ||
| 458 | /* Assume strcspn is always declared. */ | ||
| 459 | _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings " | ||
| 460 | "in multibyte locales - " | ||
| 461 | "use mbscspn if you care about internationalization"); | ||
| 462 | #endif | ||
| 463 | |||
| 464 | /* Find the first occurrence in S of any character in ACCEPT. */ | ||
| 465 | #if @GNULIB_STRPBRK@ | ||
| 466 | # if ! @HAVE_STRPBRK@ | ||
| 467 | _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) | ||
| 468 | _GL_ATTRIBUTE_PURE | ||
| 469 | _GL_ARG_NONNULL ((1, 2))); | ||
| 470 | # endif | ||
| 471 | /* On some systems, this function is defined as an overloaded function: | ||
| 472 | extern "C" { const char * strpbrk (const char *, const char *); } | ||
| 473 | extern "C++" { char * strpbrk (char *, const char *); } */ | ||
| 474 | _GL_CXXALIAS_SYS_CAST2 (strpbrk, | ||
| 475 | char *, (char const *__s, char const *__accept), | ||
| 476 | const char *, (char const *__s, char const *__accept)); | ||
| 477 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 478 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 479 | _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept)); | ||
| 480 | _GL_CXXALIASWARN1 (strpbrk, char const *, | ||
| 481 | (char const *__s, char const *__accept)); | ||
| 482 | # else | ||
| 483 | _GL_CXXALIASWARN (strpbrk); | ||
| 484 | # endif | ||
| 485 | # if defined GNULIB_POSIXCHECK | ||
| 486 | /* strpbrk() assumes the second argument is a list of single-byte characters. | ||
| 487 | Even in this simple case, it does not work with multibyte strings if the | ||
| 488 | locale encoding is GB18030 and one of the characters to be searched is a | ||
| 489 | digit. */ | ||
| 490 | # undef strpbrk | ||
| 491 | _GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings " | ||
| 492 | "in multibyte locales - " | ||
| 493 | "use mbspbrk if you care about internationalization"); | ||
| 494 | # endif | ||
| 495 | #elif defined GNULIB_POSIXCHECK | ||
| 496 | # undef strpbrk | ||
| 497 | # if HAVE_RAW_DECL_STRPBRK | ||
| 498 | _GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - " | ||
| 499 | "use gnulib module strpbrk for portability"); | ||
| 500 | # endif | ||
| 501 | #endif | ||
| 502 | |||
| 503 | #if defined GNULIB_POSIXCHECK | ||
| 504 | /* strspn() assumes the second argument is a list of single-byte characters. | ||
| 505 | Even in this simple case, it cannot work with multibyte strings. */ | ||
| 506 | # undef strspn | ||
| 507 | /* Assume strspn is always declared. */ | ||
| 508 | _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " | ||
| 509 | "in multibyte locales - " | ||
| 510 | "use mbsspn if you care about internationalization"); | ||
| 511 | #endif | ||
| 512 | |||
| 513 | #if defined GNULIB_POSIXCHECK | ||
| 514 | /* strrchr() does not work with multibyte strings if the locale encoding is | ||
| 515 | GB18030 and the character to be searched is a digit. */ | ||
| 516 | # undef strrchr | ||
| 517 | /* Assume strrchr is always declared. */ | ||
| 518 | _GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings " | ||
| 519 | "in some multibyte locales - " | ||
| 520 | "use mbsrchr if you care about internationalization"); | ||
| 521 | #endif | ||
| 522 | |||
| 523 | /* Search the next delimiter (char listed in DELIM) starting at *STRINGP. | ||
| 524 | If one is found, overwrite it with a NUL, and advance *STRINGP | ||
| 525 | to point to the next char after it. Otherwise, set *STRINGP to NULL. | ||
| 526 | If *STRINGP was already NULL, nothing happens. | ||
| 527 | Return the old value of *STRINGP. | ||
| 528 | |||
| 529 | This is a variant of strtok() that is multithread-safe and supports | ||
| 530 | empty fields. | ||
| 531 | |||
| 532 | Caveat: It modifies the original string. | ||
| 533 | Caveat: These functions cannot be used on constant strings. | ||
| 534 | Caveat: The identity of the delimiting character is lost. | ||
| 535 | Caveat: It doesn't work with multibyte strings unless all of the delimiter | ||
| 536 | characters are ASCII characters < 0x30. | ||
| 537 | |||
| 538 | See also strtok_r(). */ | ||
| 539 | #if @GNULIB_STRSEP@ | ||
| 540 | # if ! @HAVE_STRSEP@ | ||
| 541 | _GL_FUNCDECL_SYS (strsep, char *, | ||
| 542 | (char **restrict __stringp, char const *restrict __delim) | ||
| 543 | _GL_ARG_NONNULL ((1, 2))); | ||
| 544 | # endif | ||
| 545 | _GL_CXXALIAS_SYS (strsep, char *, | ||
| 546 | (char **restrict __stringp, char const *restrict __delim)); | ||
| 547 | _GL_CXXALIASWARN (strsep); | ||
| 548 | # if defined GNULIB_POSIXCHECK | ||
| 549 | # undef strsep | ||
| 550 | _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings " | ||
| 551 | "in multibyte locales - " | ||
| 552 | "use mbssep if you care about internationalization"); | ||
| 553 | # endif | ||
| 554 | #elif defined GNULIB_POSIXCHECK | ||
| 555 | # undef strsep | ||
| 556 | # if HAVE_RAW_DECL_STRSEP | ||
| 557 | _GL_WARN_ON_USE (strsep, "strsep is unportable - " | ||
| 558 | "use gnulib module strsep for portability"); | ||
| 559 | # endif | ||
| 560 | #endif | ||
| 561 | |||
| 562 | #if @GNULIB_STRSTR@ | ||
| 563 | # if @REPLACE_STRSTR@ | ||
| 564 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 565 | # define strstr rpl_strstr | ||
| 566 | # endif | ||
| 567 | _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) | ||
| 568 | _GL_ATTRIBUTE_PURE | ||
| 569 | _GL_ARG_NONNULL ((1, 2))); | ||
| 570 | _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); | ||
| 571 | # else | ||
| 572 | /* On some systems, this function is defined as an overloaded function: | ||
| 573 | extern "C++" { const char * strstr (const char *, const char *); } | ||
| 574 | extern "C++" { char * strstr (char *, const char *); } */ | ||
| 575 | _GL_CXXALIAS_SYS_CAST2 (strstr, | ||
| 576 | char *, (const char *haystack, const char *needle), | ||
| 577 | const char *, (const char *haystack, const char *needle)); | ||
| 578 | # endif | ||
| 579 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 580 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 581 | _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle)); | ||
| 582 | _GL_CXXALIASWARN1 (strstr, const char *, | ||
| 583 | (const char *haystack, const char *needle)); | ||
| 584 | # else | ||
| 585 | _GL_CXXALIASWARN (strstr); | ||
| 586 | # endif | ||
| 587 | #elif defined GNULIB_POSIXCHECK | ||
| 588 | /* strstr() does not work with multibyte strings if the locale encoding is | ||
| 589 | different from UTF-8: | ||
| 590 | POSIX says that it operates on "strings", and "string" in POSIX is defined | ||
| 591 | as a sequence of bytes, not of characters. */ | ||
| 592 | # undef strstr | ||
| 593 | /* Assume strstr is always declared. */ | ||
| 594 | _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot " | ||
| 595 | "work correctly on character strings in most " | ||
| 596 | "multibyte locales - " | ||
| 597 | "use mbsstr if you care about internationalization, " | ||
| 598 | "or use strstr if you care about speed"); | ||
| 599 | #endif | ||
| 600 | |||
| 601 | /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive | ||
| 602 | comparison. */ | ||
| 603 | #if @GNULIB_STRCASESTR@ | ||
| 604 | # if @REPLACE_STRCASESTR@ | ||
| 605 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 606 | # define strcasestr rpl_strcasestr | ||
| 607 | # endif | ||
| 608 | _GL_FUNCDECL_RPL (strcasestr, char *, | ||
| 609 | (const char *haystack, const char *needle) | ||
| 610 | _GL_ATTRIBUTE_PURE | ||
| 611 | _GL_ARG_NONNULL ((1, 2))); | ||
| 612 | _GL_CXXALIAS_RPL (strcasestr, char *, | ||
| 613 | (const char *haystack, const char *needle)); | ||
| 614 | # else | ||
| 615 | # if ! @HAVE_STRCASESTR@ | ||
| 616 | _GL_FUNCDECL_SYS (strcasestr, char *, | ||
| 617 | (const char *haystack, const char *needle) | ||
| 618 | _GL_ATTRIBUTE_PURE | ||
| 619 | _GL_ARG_NONNULL ((1, 2))); | ||
| 620 | # endif | ||
| 621 | /* On some systems, this function is defined as an overloaded function: | ||
| 622 | extern "C++" { const char * strcasestr (const char *, const char *); } | ||
| 623 | extern "C++" { char * strcasestr (char *, const char *); } */ | ||
| 624 | _GL_CXXALIAS_SYS_CAST2 (strcasestr, | ||
| 625 | char *, (const char *haystack, const char *needle), | ||
| 626 | const char *, (const char *haystack, const char *needle)); | ||
| 627 | # endif | ||
| 628 | # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ | ||
| 629 | && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) | ||
| 630 | _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle)); | ||
| 631 | _GL_CXXALIASWARN1 (strcasestr, const char *, | ||
| 632 | (const char *haystack, const char *needle)); | ||
| 633 | # else | ||
| 634 | _GL_CXXALIASWARN (strcasestr); | ||
| 635 | # endif | ||
| 636 | #elif defined GNULIB_POSIXCHECK | ||
| 637 | /* strcasestr() does not work with multibyte strings: | ||
| 638 | It is a glibc extension, and glibc implements it only for unibyte | ||
| 639 | locales. */ | ||
| 640 | # undef strcasestr | ||
| 641 | # if HAVE_RAW_DECL_STRCASESTR | ||
| 642 | _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character " | ||
| 643 | "strings in multibyte locales - " | ||
| 644 | "use mbscasestr if you care about " | ||
| 645 | "internationalization, or use c-strcasestr if you want " | ||
| 646 | "a locale independent function"); | ||
| 647 | # endif | ||
| 648 | #endif | ||
| 649 | |||
| 650 | /* Parse S into tokens separated by characters in DELIM. | ||
| 651 | If S is NULL, the saved pointer in SAVE_PTR is used as | ||
| 652 | the next starting point. For example: | ||
| 653 | char s[] = "-abc-=-def"; | ||
| 654 | char *sp; | ||
| 655 | x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" | ||
| 656 | x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL | ||
| 657 | x = strtok_r(NULL, "=", &sp); // x = NULL | ||
| 658 | // s = "abc\0-def\0" | ||
| 659 | |||
| 660 | This is a variant of strtok() that is multithread-safe. | ||
| 661 | |||
| 662 | For the POSIX documentation for this function, see: | ||
| 663 | http://www.opengroup.org/susv3xsh/strtok.html | ||
| 664 | |||
| 665 | Caveat: It modifies the original string. | ||
| 666 | Caveat: These functions cannot be used on constant strings. | ||
| 667 | Caveat: The identity of the delimiting character is lost. | ||
| 668 | Caveat: It doesn't work with multibyte strings unless all of the delimiter | ||
| 669 | characters are ASCII characters < 0x30. | ||
| 670 | |||
| 671 | See also strsep(). */ | ||
| 672 | #if @GNULIB_STRTOK_R@ | ||
| 673 | # if @REPLACE_STRTOK_R@ | ||
| 674 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 675 | # undef strtok_r | ||
| 676 | # define strtok_r rpl_strtok_r | ||
| 677 | # endif | ||
| 678 | _GL_FUNCDECL_RPL (strtok_r, char *, | ||
| 679 | (char *restrict s, char const *restrict delim, | ||
| 680 | char **restrict save_ptr) | ||
| 681 | _GL_ARG_NONNULL ((2, 3))); | ||
| 682 | _GL_CXXALIAS_RPL (strtok_r, char *, | ||
| 683 | (char *restrict s, char const *restrict delim, | ||
| 684 | char **restrict save_ptr)); | ||
| 685 | # else | ||
| 686 | # if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK | ||
| 687 | # undef strtok_r | ||
| 688 | # endif | ||
| 689 | # if ! @HAVE_DECL_STRTOK_R@ | ||
| 690 | _GL_FUNCDECL_SYS (strtok_r, char *, | ||
| 691 | (char *restrict s, char const *restrict delim, | ||
| 692 | char **restrict save_ptr) | ||
| 693 | _GL_ARG_NONNULL ((2, 3))); | ||
| 694 | # endif | ||
| 695 | _GL_CXXALIAS_SYS (strtok_r, char *, | ||
| 696 | (char *restrict s, char const *restrict delim, | ||
| 697 | char **restrict save_ptr)); | ||
| 698 | # endif | ||
| 699 | _GL_CXXALIASWARN (strtok_r); | ||
| 700 | # if defined GNULIB_POSIXCHECK | ||
| 701 | _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character " | ||
| 702 | "strings in multibyte locales - " | ||
| 703 | "use mbstok_r if you care about internationalization"); | ||
| 704 | # endif | ||
| 705 | #elif defined GNULIB_POSIXCHECK | ||
| 706 | # undef strtok_r | ||
| 707 | # if HAVE_RAW_DECL_STRTOK_R | ||
| 708 | _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - " | ||
| 709 | "use gnulib module strtok_r for portability"); | ||
| 710 | # endif | ||
| 711 | #endif | ||
| 712 | |||
| 713 | |||
| 714 | /* The following functions are not specified by POSIX. They are gnulib | ||
| 715 | extensions. */ | ||
| 716 | |||
| 717 | #if @GNULIB_MBSLEN@ | ||
| 718 | /* Return the number of multibyte characters in the character string STRING. | ||
| 719 | This considers multibyte characters, unlike strlen, which counts bytes. */ | ||
| 720 | # ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */ | ||
| 721 | # undef mbslen | ||
| 722 | # endif | ||
| 723 | # if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */ | ||
| 724 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 725 | # define mbslen rpl_mbslen | ||
| 726 | # endif | ||
| 727 | _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) | ||
| 728 | _GL_ATTRIBUTE_PURE | ||
| 729 | _GL_ARG_NONNULL ((1))); | ||
| 730 | _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string)); | ||
| 731 | # else | ||
| 732 | _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) | ||
| 733 | _GL_ATTRIBUTE_PURE | ||
| 734 | _GL_ARG_NONNULL ((1))); | ||
| 735 | _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string)); | ||
| 736 | # endif | ||
| 737 | _GL_CXXALIASWARN (mbslen); | ||
| 738 | #endif | ||
| 739 | |||
| 740 | #if @GNULIB_MBSNLEN@ | ||
| 741 | /* Return the number of multibyte characters in the character string starting | ||
| 742 | at STRING and ending at STRING + LEN. */ | ||
| 743 | _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len) | ||
| 744 | _GL_ATTRIBUTE_PURE | ||
| 745 | _GL_ARG_NONNULL ((1)); | ||
| 746 | #endif | ||
| 747 | |||
| 748 | #if @GNULIB_MBSCHR@ | ||
| 749 | /* Locate the first single-byte character C in the character string STRING, | ||
| 750 | and return a pointer to it. Return NULL if C is not found in STRING. | ||
| 751 | Unlike strchr(), this function works correctly in multibyte locales with | ||
| 752 | encodings such as GB18030. */ | ||
| 753 | # if defined __hpux | ||
| 754 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 755 | # define mbschr rpl_mbschr /* avoid collision with HP-UX function */ | ||
| 756 | # endif | ||
| 757 | _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c) | ||
| 758 | _GL_ATTRIBUTE_PURE | ||
| 759 | _GL_ARG_NONNULL ((1))); | ||
| 760 | _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c)); | ||
| 761 | # else | ||
| 762 | _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c) | ||
| 763 | _GL_ATTRIBUTE_PURE | ||
| 764 | _GL_ARG_NONNULL ((1))); | ||
| 765 | _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c)); | ||
| 766 | # endif | ||
| 767 | _GL_CXXALIASWARN (mbschr); | ||
| 768 | #endif | ||
| 769 | |||
| 770 | #if @GNULIB_MBSRCHR@ | ||
| 771 | /* Locate the last single-byte character C in the character string STRING, | ||
| 772 | and return a pointer to it. Return NULL if C is not found in STRING. | ||
| 773 | Unlike strrchr(), this function works correctly in multibyte locales with | ||
| 774 | encodings such as GB18030. */ | ||
| 775 | # if defined __hpux || defined __INTERIX | ||
| 776 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 777 | # define mbsrchr rpl_mbsrchr /* avoid collision with system function */ | ||
| 778 | # endif | ||
| 779 | _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c) | ||
| 780 | _GL_ATTRIBUTE_PURE | ||
| 781 | _GL_ARG_NONNULL ((1))); | ||
| 782 | _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c)); | ||
| 783 | # else | ||
| 784 | _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c) | ||
| 785 | _GL_ATTRIBUTE_PURE | ||
| 786 | _GL_ARG_NONNULL ((1))); | ||
| 787 | _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c)); | ||
| 788 | # endif | ||
| 789 | _GL_CXXALIASWARN (mbsrchr); | ||
| 790 | #endif | ||
| 791 | |||
| 792 | #if @GNULIB_MBSSTR@ | ||
| 793 | /* Find the first occurrence of the character string NEEDLE in the character | ||
| 794 | string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. | ||
| 795 | Unlike strstr(), this function works correctly in multibyte locales with | ||
| 796 | encodings different from UTF-8. */ | ||
| 797 | _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle) | ||
| 798 | _GL_ATTRIBUTE_PURE | ||
| 799 | _GL_ARG_NONNULL ((1, 2)); | ||
| 800 | #endif | ||
| 801 | |||
| 802 | #if @GNULIB_MBSCASECMP@ | ||
| 803 | /* Compare the character strings S1 and S2, ignoring case, returning less than, | ||
| 804 | equal to or greater than zero if S1 is lexicographically less than, equal to | ||
| 805 | or greater than S2. | ||
| 806 | Note: This function may, in multibyte locales, return 0 for strings of | ||
| 807 | different lengths! | ||
| 808 | Unlike strcasecmp(), this function works correctly in multibyte locales. */ | ||
| 809 | _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2) | ||
| 810 | _GL_ATTRIBUTE_PURE | ||
| 811 | _GL_ARG_NONNULL ((1, 2)); | ||
| 812 | #endif | ||
| 813 | |||
| 814 | #if @GNULIB_MBSNCASECMP@ | ||
| 815 | /* Compare the initial segment of the character string S1 consisting of at most | ||
| 816 | N characters with the initial segment of the character string S2 consisting | ||
| 817 | of at most N characters, ignoring case, returning less than, equal to or | ||
| 818 | greater than zero if the initial segment of S1 is lexicographically less | ||
| 819 | than, equal to or greater than the initial segment of S2. | ||
| 820 | Note: This function may, in multibyte locales, return 0 for initial segments | ||
| 821 | of different lengths! | ||
| 822 | Unlike strncasecmp(), this function works correctly in multibyte locales. | ||
| 823 | But beware that N is not a byte count but a character count! */ | ||
| 824 | _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n) | ||
| 825 | _GL_ATTRIBUTE_PURE | ||
| 826 | _GL_ARG_NONNULL ((1, 2)); | ||
| 827 | #endif | ||
| 828 | |||
| 829 | #if @GNULIB_MBSPCASECMP@ | ||
| 830 | /* Compare the initial segment of the character string STRING consisting of | ||
| 831 | at most mbslen (PREFIX) characters with the character string PREFIX, | ||
| 832 | ignoring case. If the two match, return a pointer to the first byte | ||
| 833 | after this prefix in STRING. Otherwise, return NULL. | ||
| 834 | Note: This function may, in multibyte locales, return non-NULL if STRING | ||
| 835 | is of smaller length than PREFIX! | ||
| 836 | Unlike strncasecmp(), this function works correctly in multibyte | ||
| 837 | locales. */ | ||
| 838 | _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix) | ||
| 839 | _GL_ATTRIBUTE_PURE | ||
| 840 | _GL_ARG_NONNULL ((1, 2)); | ||
| 841 | #endif | ||
| 842 | |||
| 843 | #if @GNULIB_MBSCASESTR@ | ||
| 844 | /* Find the first occurrence of the character string NEEDLE in the character | ||
| 845 | string HAYSTACK, using case-insensitive comparison. | ||
| 846 | Note: This function may, in multibyte locales, return success even if | ||
| 847 | strlen (haystack) < strlen (needle) ! | ||
| 848 | Unlike strcasestr(), this function works correctly in multibyte locales. */ | ||
| 849 | _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle) | ||
| 850 | _GL_ATTRIBUTE_PURE | ||
| 851 | _GL_ARG_NONNULL ((1, 2)); | ||
| 852 | #endif | ||
| 853 | |||
| 854 | #if @GNULIB_MBSCSPN@ | ||
| 855 | /* Find the first occurrence in the character string STRING of any character | ||
| 856 | in the character string ACCEPT. Return the number of bytes from the | ||
| 857 | beginning of the string to this occurrence, or to the end of the string | ||
| 858 | if none exists. | ||
| 859 | Unlike strcspn(), this function works correctly in multibyte locales. */ | ||
| 860 | _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept) | ||
| 861 | _GL_ATTRIBUTE_PURE | ||
| 862 | _GL_ARG_NONNULL ((1, 2)); | ||
| 863 | #endif | ||
| 864 | |||
| 865 | #if @GNULIB_MBSPBRK@ | ||
| 866 | /* Find the first occurrence in the character string STRING of any character | ||
| 867 | in the character string ACCEPT. Return the pointer to it, or NULL if none | ||
| 868 | exists. | ||
| 869 | Unlike strpbrk(), this function works correctly in multibyte locales. */ | ||
| 870 | # if defined __hpux | ||
| 871 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 872 | # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ | ||
| 873 | # endif | ||
| 874 | _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept) | ||
| 875 | _GL_ATTRIBUTE_PURE | ||
| 876 | _GL_ARG_NONNULL ((1, 2))); | ||
| 877 | _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept)); | ||
| 878 | # else | ||
| 879 | _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept) | ||
| 880 | _GL_ATTRIBUTE_PURE | ||
| 881 | _GL_ARG_NONNULL ((1, 2))); | ||
| 882 | _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept)); | ||
| 883 | # endif | ||
| 884 | _GL_CXXALIASWARN (mbspbrk); | ||
| 885 | #endif | ||
| 886 | |||
| 887 | #if @GNULIB_MBSSPN@ | ||
| 888 | /* Find the first occurrence in the character string STRING of any character | ||
| 889 | not in the character string REJECT. Return the number of bytes from the | ||
| 890 | beginning of the string to this occurrence, or to the end of the string | ||
| 891 | if none exists. | ||
| 892 | Unlike strspn(), this function works correctly in multibyte locales. */ | ||
| 893 | _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject) | ||
| 894 | _GL_ATTRIBUTE_PURE | ||
| 895 | _GL_ARG_NONNULL ((1, 2)); | ||
| 896 | #endif | ||
| 897 | |||
| 898 | #if @GNULIB_MBSSEP@ | ||
| 899 | /* Search the next delimiter (multibyte character listed in the character | ||
| 900 | string DELIM) starting at the character string *STRINGP. | ||
| 901 | If one is found, overwrite it with a NUL, and advance *STRINGP to point | ||
| 902 | to the next multibyte character after it. Otherwise, set *STRINGP to NULL. | ||
| 903 | If *STRINGP was already NULL, nothing happens. | ||
| 904 | Return the old value of *STRINGP. | ||
| 905 | |||
| 906 | This is a variant of mbstok_r() that supports empty fields. | ||
| 907 | |||
| 908 | Caveat: It modifies the original string. | ||
| 909 | Caveat: These functions cannot be used on constant strings. | ||
| 910 | Caveat: The identity of the delimiting character is lost. | ||
| 911 | |||
| 912 | See also mbstok_r(). */ | ||
| 913 | _GL_EXTERN_C char * mbssep (char **stringp, const char *delim) | ||
| 914 | _GL_ARG_NONNULL ((1, 2)); | ||
| 915 | #endif | ||
| 916 | |||
| 917 | #if @GNULIB_MBSTOK_R@ | ||
| 918 | /* Parse the character string STRING into tokens separated by characters in | ||
| 919 | the character string DELIM. | ||
| 920 | If STRING is NULL, the saved pointer in SAVE_PTR is used as | ||
| 921 | the next starting point. For example: | ||
| 922 | char s[] = "-abc-=-def"; | ||
| 923 | char *sp; | ||
| 924 | x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" | ||
| 925 | x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL | ||
| 926 | x = mbstok_r(NULL, "=", &sp); // x = NULL | ||
| 927 | // s = "abc\0-def\0" | ||
| 928 | |||
| 929 | Caveat: It modifies the original string. | ||
| 930 | Caveat: These functions cannot be used on constant strings. | ||
| 931 | Caveat: The identity of the delimiting character is lost. | ||
| 932 | |||
| 933 | See also mbssep(). */ | ||
| 934 | _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr) | ||
| 935 | _GL_ARG_NONNULL ((2, 3)); | ||
| 936 | #endif | ||
| 937 | |||
| 938 | /* Map any int, typically from errno, into an error message. */ | ||
| 939 | #if @GNULIB_STRERROR@ | ||
| 940 | # if @REPLACE_STRERROR@ | ||
| 941 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 942 | # undef strerror | ||
| 943 | # define strerror rpl_strerror | ||
| 944 | # endif | ||
| 945 | _GL_FUNCDECL_RPL (strerror, char *, (int)); | ||
| 946 | _GL_CXXALIAS_RPL (strerror, char *, (int)); | ||
| 947 | # else | ||
| 948 | _GL_CXXALIAS_SYS (strerror, char *, (int)); | ||
| 949 | # endif | ||
| 950 | _GL_CXXALIASWARN (strerror); | ||
| 951 | #elif defined GNULIB_POSIXCHECK | ||
| 952 | # undef strerror | ||
| 953 | /* Assume strerror is always declared. */ | ||
| 954 | _GL_WARN_ON_USE (strerror, "strerror is unportable - " | ||
| 955 | "use gnulib module strerror to guarantee non-NULL result"); | ||
| 956 | #endif | ||
| 957 | |||
| 958 | /* Map any int, typically from errno, into an error message. Multithread-safe. | ||
| 959 | Uses the POSIX declaration, not the glibc declaration. */ | ||
| 960 | #if @GNULIB_STRERROR_R@ | ||
| 961 | # if @REPLACE_STRERROR_R@ | ||
| 962 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 963 | # undef strerror_r | ||
| 964 | # define strerror_r rpl_strerror_r | ||
| 965 | # endif | ||
| 966 | _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen) | ||
| 967 | _GL_ARG_NONNULL ((2))); | ||
| 968 | _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)); | ||
| 969 | # else | ||
| 970 | # if !@HAVE_DECL_STRERROR_R@ | ||
| 971 | _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen) | ||
| 972 | _GL_ARG_NONNULL ((2))); | ||
| 973 | # endif | ||
| 974 | _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)); | ||
| 975 | # endif | ||
| 976 | # if @HAVE_DECL_STRERROR_R@ | ||
| 977 | _GL_CXXALIASWARN (strerror_r); | ||
| 978 | # endif | ||
| 979 | #elif defined GNULIB_POSIXCHECK | ||
| 980 | # undef strerror_r | ||
| 981 | # if HAVE_RAW_DECL_STRERROR_R | ||
| 982 | _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " | ||
| 983 | "use gnulib module strerror_r-posix for portability"); | ||
| 984 | # endif | ||
| 985 | #endif | ||
| 986 | |||
| 987 | #if @GNULIB_STRSIGNAL@ | ||
| 988 | # if @REPLACE_STRSIGNAL@ | ||
| 989 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 990 | # define strsignal rpl_strsignal | ||
| 991 | # endif | ||
| 992 | _GL_FUNCDECL_RPL (strsignal, char *, (int __sig)); | ||
| 993 | _GL_CXXALIAS_RPL (strsignal, char *, (int __sig)); | ||
| 994 | # else | ||
| 995 | # if ! @HAVE_DECL_STRSIGNAL@ | ||
| 996 | _GL_FUNCDECL_SYS (strsignal, char *, (int __sig)); | ||
| 997 | # endif | ||
| 998 | /* Need to cast, because on Cygwin 1.5.x systems, the return type is | ||
| 999 | 'const char *'. */ | ||
| 1000 | _GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig)); | ||
| 1001 | # endif | ||
| 1002 | _GL_CXXALIASWARN (strsignal); | ||
| 1003 | #elif defined GNULIB_POSIXCHECK | ||
| 1004 | # undef strsignal | ||
| 1005 | # if HAVE_RAW_DECL_STRSIGNAL | ||
| 1006 | _GL_WARN_ON_USE (strsignal, "strsignal is unportable - " | ||
| 1007 | "use gnulib module strsignal for portability"); | ||
| 1008 | # endif | ||
| 1009 | #endif | ||
| 1010 | |||
| 1011 | #if @GNULIB_STRVERSCMP@ | ||
| 1012 | # if !@HAVE_STRVERSCMP@ | ||
| 1013 | _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *) | ||
| 1014 | _GL_ATTRIBUTE_PURE | ||
| 1015 | _GL_ARG_NONNULL ((1, 2))); | ||
| 1016 | # endif | ||
| 1017 | _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *)); | ||
| 1018 | _GL_CXXALIASWARN (strverscmp); | ||
| 1019 | #elif defined GNULIB_POSIXCHECK | ||
| 1020 | # undef strverscmp | ||
| 1021 | # if HAVE_RAW_DECL_STRVERSCMP | ||
| 1022 | _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - " | ||
| 1023 | "use gnulib module strverscmp for portability"); | ||
| 1024 | # endif | ||
| 1025 | #endif | ||
| 1026 | |||
| 1027 | |||
| 1028 | #endif /* _@GUARD_PREFIX@_STRING_H */ | ||
| 1029 | #endif /* _@GUARD_PREFIX@_STRING_H */ | ||
diff --git a/lib/unsetenv.c b/lib/unsetenv.c index eea21129031..c58c82f4f44 100644 --- a/lib/unsetenv.c +++ b/lib/unsetenv.c | |||
| @@ -14,12 +14,12 @@ | |||
| 14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 16 | 16 | ||
| 17 | #include <config.h> | ||
| 18 | |||
| 19 | /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc | 17 | /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc |
| 20 | optimizes away the name == NULL test below. */ | 18 | optimizes away the name == NULL test below. */ |
| 21 | #define _GL_ARG_NONNULL(params) | 19 | #define _GL_ARG_NONNULL(params) |
| 22 | 20 | ||
| 21 | #include <config.h> | ||
| 22 | |||
| 23 | /* Specification. */ | 23 | /* Specification. */ |
| 24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 25 | 25 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd2186fcfb2..18c11debf0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,47 @@ | |||
| 1 | 2013-02-12 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-adb-handle-start-file-process): Rewrite. | ||
| 4 | |||
| 5 | * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' | ||
| 6 | only if it doesn't exist. | ||
| 7 | |||
| 8 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): Set | ||
| 9 | process marker. | ||
| 10 | |||
| 11 | 2013-02-12 Tassilo Horn <tsdh@gnu.org> | ||
| 12 | |||
| 13 | * doc-view.el (doc-view-odf->pdf-converter-soffice): Use separate | ||
| 14 | UserInstallation when calling soffice to work around LibreOffice | ||
| 15 | bug 37531. | ||
| 16 | |||
| 17 | 2013-02-12 Glenn Morris <rgm@gnu.org> | ||
| 18 | |||
| 19 | * files.el (basic-save-buffer): | ||
| 20 | Offer to create a non-existing directory. (Bug#3016) | ||
| 21 | |||
| 22 | * calc/calc-graph.el (calc-graph-show-dumb): | ||
| 23 | * calendar/calendar.el (calendar-mode-map): | ||
| 24 | * cus-edit.el (custom-mode-map): | ||
| 25 | * ehelp.el (electric-help-map): | ||
| 26 | * emulation/vip.el (vip-mode-map): | ||
| 27 | * epa.el (epa-key-list-mode-map): | ||
| 28 | * info.el (Info-mode-map): | ||
| 29 | * mail/rmail.el (rmail-mode-map): | ||
| 30 | * mail/rmailsum.el (rmail-summary-mode-map): | ||
| 31 | * man.el (Man-mode-map): | ||
| 32 | * net/newst-plainview.el (newsticker-mode-map): | ||
| 33 | * progmodes/cpp.el (cpp-edit-mode-map): | ||
| 34 | * progmodes/grep.el (grep-mode-map): | ||
| 35 | * progmodes/idlw-help.el (idlwave-help-mode-map): | ||
| 36 | * simple.el (special-mode-map): | ||
| 37 | * startup.el (splash-screen-keymap): | ||
| 38 | * view.el (view-mode-map): | ||
| 39 | Make S-SPC scroll in the opposite sense to SPC. (Bug#2145) | ||
| 40 | |||
| 1 | 2013-02-11 Elias Pipping <pipping@lavabit.com> | 41 | 2013-02-11 Elias Pipping <pipping@lavabit.com> |
| 2 | 42 | ||
| 3 | * doc-view.el (doc-view-current-cache-dir): Beware % escapes | 43 | * doc-view.el (doc-view-current-cache-dir): Beware % escapes |
| 4 | (bug#13689). | 44 | (bug#13679). |
| 5 | 45 | ||
| 6 | 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca> | 46 | 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | 47 | ||
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 4376e21b4ca..c84c7fdf949 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el | |||
| @@ -948,6 +948,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." | |||
| 948 | (setq calc-dumb-map (make-sparse-keymap)) | 948 | (setq calc-dumb-map (make-sparse-keymap)) |
| 949 | (define-key calc-dumb-map "\n" 'scroll-up-command) | 949 | (define-key calc-dumb-map "\n" 'scroll-up-command) |
| 950 | (define-key calc-dumb-map " " 'scroll-up-command) | 950 | (define-key calc-dumb-map " " 'scroll-up-command) |
| 951 | (define-key calc-dump-map [?\S-\ ] 'scroll-down-command) | ||
| 951 | (define-key calc-dumb-map "\177" 'scroll-down-command) | 952 | (define-key calc-dumb-map "\177" 'scroll-down-command) |
| 952 | (define-key calc-dumb-map "<" 'scroll-left) | 953 | (define-key calc-dumb-map "<" 'scroll-left) |
| 953 | (define-key calc-dumb-map ">" 'scroll-right) | 954 | (define-key calc-dumb-map ">" 'scroll-right) |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 74d3ce80338..20a8684e387 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1635,6 +1635,7 @@ line." | |||
| 1635 | (define-key map "S" 'calendar-sunrise-sunset) | 1635 | (define-key map "S" 'calendar-sunrise-sunset) |
| 1636 | (define-key map "M" 'calendar-lunar-phases) | 1636 | (define-key map "M" 'calendar-lunar-phases) |
| 1637 | (define-key map " " 'scroll-other-window) | 1637 | (define-key map " " 'scroll-other-window) |
| 1638 | (define-key map [?\S-\ ] 'scroll-other-window-down) | ||
| 1638 | (define-key map "\d" 'scroll-other-window-down) | 1639 | (define-key map "\d" 'scroll-other-window-down) |
| 1639 | (define-key map "\C-c\C-l" 'calendar-redraw) | 1640 | (define-key map "\C-c\C-l" 'calendar-redraw) |
| 1640 | (define-key map "." 'calendar-goto-today) | 1641 | (define-key map "." 'calendar-goto-today) |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 6d1ebe5a962..d19e2ded00c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -443,6 +443,7 @@ | |||
| 443 | (define-key map [remap self-insert-command] 'Custom-no-edit) | 443 | (define-key map [remap self-insert-command] 'Custom-no-edit) |
| 444 | (define-key map "\^m" 'Custom-newline) | 444 | (define-key map "\^m" 'Custom-newline) |
| 445 | (define-key map " " 'scroll-up-command) | 445 | (define-key map " " 'scroll-up-command) |
| 446 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 446 | (define-key map "\177" 'scroll-down-command) | 447 | (define-key map "\177" 'scroll-down-command) |
| 447 | (define-key map "\C-c\C-c" 'Custom-set) | 448 | (define-key map "\C-c\C-c" 'Custom-set) |
| 448 | (define-key map "\C-x\C-s" 'Custom-save) | 449 | (define-key map "\C-x\C-s" 'Custom-save) |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index edd59a7b518..dcc28a52322 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -939,10 +939,21 @@ is named like ODF with the extension turned to pdf." | |||
| 939 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. | 939 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. |
| 940 | The converted PDF is put into the current cache directory, and it | 940 | The converted PDF is put into the current cache directory, and it |
| 941 | is named like ODF with the extension turned to pdf." | 941 | is named like ODF with the extension turned to pdf." |
| 942 | (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program | 942 | ;; FIXME: soffice doesn't work when there's another running |
| 943 | (list "--headless" "--convert-to" "pdf" | 943 | ;; LibreOffice instance, in which case it returns success without |
| 944 | "--outdir" (doc-view-current-cache-dir) odf) | 944 | ;; actually doing anything. See LibreOffice bug |
| 945 | callback)) | 945 | ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531. A workaround |
| 946 | ;; is to start soffice with a separate UserInstallation directory. | ||
| 947 | (let ((tmp-user-install-dir (make-temp-file "libreoffice-docview" t))) | ||
| 948 | (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program | ||
| 949 | (list | ||
| 950 | (concat "-env:UserInstallation=file://" | ||
| 951 | tmp-user-install-dir) | ||
| 952 | "--headless" "--convert-to" "pdf" | ||
| 953 | "--outdir" (doc-view-current-cache-dir) odf) | ||
| 954 | (lambda () | ||
| 955 | (delete-directory tmp-user-install-dir t) | ||
| 956 | (funcall callback))))) | ||
| 946 | 957 | ||
| 947 | (defun doc-view-pdf/ps->png (pdf-ps png) | 958 | (defun doc-view-pdf/ps->png (pdf-ps png) |
| 948 | ;; FIXME: Fix name and docstring to account for djvu&tiff. | 959 | ;; FIXME: Fix name and docstring to account for djvu&tiff. |
diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 416666f918c..88fc87b5b7a 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el | |||
| @@ -80,6 +80,7 @@ | |||
| 80 | (define-key map (char-to-string help-char) 'electric-help-help) | 80 | (define-key map (char-to-string help-char) 'electric-help-help) |
| 81 | (define-key map "?" 'electric-help-help) | 81 | (define-key map "?" 'electric-help-help) |
| 82 | (define-key map " " 'scroll-up) | 82 | (define-key map " " 'scroll-up) |
| 83 | (define-key map [?\S-\ ] 'scroll-down) | ||
| 83 | (define-key map "\^?" 'scroll-down) | 84 | (define-key map "\^?" 'scroll-down) |
| 84 | (define-key map "." 'beginning-of-buffer) | 85 | (define-key map "." 'beginning-of-buffer) |
| 85 | (define-key map "<" 'beginning-of-buffer) | 86 | (define-key map "<" 'beginning-of-buffer) |
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index 4e6749d9cfb..e086f26e8ab 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el | |||
| @@ -183,6 +183,7 @@ If nil then it is bound to `delete-backward-char'." | |||
| 183 | (define-key map "\C-z" 'vip-change-mode-to-emacs) | 183 | (define-key map "\C-z" 'vip-change-mode-to-emacs) |
| 184 | (define-key map "\e" 'vip-ESC) | 184 | (define-key map "\e" 'vip-ESC) |
| 185 | 185 | ||
| 186 | (define-key map [?\S-\ ] 'vip-scroll-back) | ||
| 186 | (define-key map " " 'vip-scroll) | 187 | (define-key map " " 'vip-scroll) |
| 187 | (define-key map "!" 'vip-command-argument) | 188 | (define-key map "!" 'vip-command-argument) |
| 188 | (define-key map "\"" 'vip-command-argument) | 189 | (define-key map "\"" 'vip-command-argument) |
diff --git a/lisp/epa.el b/lisp/epa.el index 61a1378aa22..852d10b1cf7 100644 --- a/lisp/epa.el +++ b/lisp/epa.el | |||
| @@ -169,6 +169,7 @@ You should bind this variable with `let', but do not set it globally.") | |||
| 169 | (define-key keymap "n" 'next-line) | 169 | (define-key keymap "n" 'next-line) |
| 170 | (define-key keymap "p" 'previous-line) | 170 | (define-key keymap "p" 'previous-line) |
| 171 | (define-key keymap " " 'scroll-up-command) | 171 | (define-key keymap " " 'scroll-up-command) |
| 172 | (define-key keymap [?\S-\ ] 'scroll-down-command) | ||
| 172 | (define-key keymap [delete] 'scroll-down-command) | 173 | (define-key keymap [delete] 'scroll-down-command) |
| 173 | (define-key keymap "q" 'epa-exit-buffer) | 174 | (define-key keymap "q" 'epa-exit-buffer) |
| 174 | (define-key keymap [menu-bar epa-key-list-mode] (cons "Keys" menu-map)) | 175 | (define-key keymap [menu-bar epa-key-list-mode] (cons "Keys" menu-map)) |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index cc7624dee03..3245c31384a 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-12 Aidan Gauland <aidalgol@no8wireless.co.nz> | ||
| 2 | |||
| 3 | * erc-match.el (erc-match-message): | ||
| 4 | Don't truncate action messages. (Bug#13689) | ||
| 5 | |||
| 1 | 2013-02-09 Eli Zaretskii <eliz@gnu.org> | 6 | 2013-02-09 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type. | 8 | * erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type. |
diff --git a/lisp/files.el b/lisp/files.el index 890834d4af0..f9ed65b8ac0 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4563,28 +4563,39 @@ Before and after saving the buffer, this function runs | |||
| 4563 | (not (file-exists-p buffer-file-name)))) | 4563 | (not (file-exists-p buffer-file-name)))) |
| 4564 | (let ((recent-save (recent-auto-save-p)) | 4564 | (let ((recent-save (recent-auto-save-p)) |
| 4565 | setmodes) | 4565 | setmodes) |
| 4566 | ;; If buffer has no file name, ask user for one. | 4566 | (if buffer-file-name |
| 4567 | (or buffer-file-name | 4567 | (let ((dir (file-name-directory |
| 4568 | (let ((filename | 4568 | (expand-file-name buffer-file-name)))) |
| 4569 | (expand-file-name | 4569 | (unless (file-exists-p dir) |
| 4570 | (read-file-name "File to save in: " | 4570 | (if (y-or-n-p |
| 4571 | nil (expand-file-name (buffer-name)))))) | 4571 | (format "Directory `%s' does not exist; create? " dir)) |
| 4572 | (if (file-exists-p filename) | 4572 | (make-directory dir t) |
| 4573 | (if (file-directory-p filename) | 4573 | (error "Canceled")))) |
| 4574 | ;; Signal an error if the user specified the name of an | 4574 | ;; If buffer has no file name, ask user for one. |
| 4575 | ;; existing directory. | 4575 | (let ((filename |
| 4576 | (error "%s is a directory" filename) | 4576 | (expand-file-name |
| 4577 | (unless (y-or-n-p (format "File `%s' exists; overwrite? " | 4577 | (read-file-name "File to save in: " |
| 4578 | filename)) | 4578 | nil (expand-file-name (buffer-name)))))) |
| 4579 | (error "Canceled"))) | 4579 | (if (file-exists-p filename) |
| 4580 | ;; Signal an error if the specified name refers to a | 4580 | (if (file-directory-p filename) |
| 4581 | ;; non-existing directory. | 4581 | ;; Signal an error if the user specified the name of an |
| 4582 | (let ((dir (file-name-directory filename))) | 4582 | ;; existing directory. |
| 4583 | (unless (file-directory-p dir) | 4583 | (error "%s is a directory" filename) |
| 4584 | (if (file-exists-p dir) | 4584 | (unless (y-or-n-p (format "File `%s' exists; overwrite? " |
| 4585 | (error "%s is not a directory" dir) | 4585 | filename)) |
| 4586 | (error "%s: no such directory" dir))))) | 4586 | (error "Canceled"))) |
| 4587 | (set-visited-file-name filename))) | 4587 | ;; Signal an error if the specified name refers to a |
| 4588 | ;; non-existing directory. | ||
| 4589 | (let ((dir (file-name-directory filename))) | ||
| 4590 | (unless (file-directory-p dir) | ||
| 4591 | (if (file-exists-p dir) | ||
| 4592 | (error "%s is not a directory" dir) | ||
| 4593 | (if (y-or-n-p | ||
| 4594 | (format "Directory `%s' does not exist; create? " | ||
| 4595 | dir)) | ||
| 4596 | (make-directory dir t) | ||
| 4597 | (error "Canceled")))))) | ||
| 4598 | (set-visited-file-name filename))) | ||
| 4588 | (or (verify-visited-file-modtime (current-buffer)) | 4599 | (or (verify-visited-file-modtime (current-buffer)) |
| 4589 | (not (file-exists-p buffer-file-name)) | 4600 | (not (file-exists-p buffer-file-name)) |
| 4590 | (yes-or-no-p | 4601 | (yes-or-no-p |
diff --git a/lisp/info.el b/lisp/info.el index c276420fb7d..a6db9f3f4dc 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -3874,6 +3874,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." | |||
| 3874 | (suppress-keymap map) | 3874 | (suppress-keymap map) |
| 3875 | (define-key map "." 'beginning-of-buffer) | 3875 | (define-key map "." 'beginning-of-buffer) |
| 3876 | (define-key map " " 'Info-scroll-up) | 3876 | (define-key map " " 'Info-scroll-up) |
| 3877 | (define-key map [?\S-\ ] 'Info-scroll-down) | ||
| 3877 | (define-key map "\C-m" 'Info-follow-nearest-node) | 3878 | (define-key map "\C-m" 'Info-follow-nearest-node) |
| 3878 | (define-key map "\t" 'Info-next-reference) | 3879 | (define-key map "\t" 'Info-next-reference) |
| 3879 | (define-key map "\e\t" 'Info-prev-reference) | 3880 | (define-key map "\e\t" 'Info-prev-reference) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 96d341c30d2..02703026e84 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -1085,6 +1085,7 @@ The buffer is expected to be narrowed to just the header of the message." | |||
| 1085 | (define-key map "<" 'rmail-first-message) | 1085 | (define-key map "<" 'rmail-first-message) |
| 1086 | (define-key map ">" 'rmail-last-message) | 1086 | (define-key map ">" 'rmail-last-message) |
| 1087 | (define-key map " " 'scroll-up-command) | 1087 | (define-key map " " 'scroll-up-command) |
| 1088 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 1088 | (define-key map "\177" 'scroll-down-command) | 1089 | (define-key map "\177" 'scroll-down-command) |
| 1089 | (define-key map "?" 'describe-mode) | 1090 | (define-key map "?" 'describe-mode) |
| 1090 | (define-key map "\C-c\C-s\C-d" 'rmail-sort-by-date) | 1091 | (define-key map "\C-c\C-s\C-d" 'rmail-sort-by-date) |
| @@ -4751,7 +4752,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order. | |||
| 4751 | 4752 | ||
| 4752 | ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic | 4753 | ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic |
| 4753 | ;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels | 4754 | ;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels |
| 4754 | ;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "341825201e892b8fc875c1ae49ffd560") | 4755 | ;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "119ce8b431f01e7f54bb6fa99603b3d9") |
| 4755 | ;;; Generated autoloads from rmailsum.el | 4756 | ;;; Generated autoloads from rmailsum.el |
| 4756 | 4757 | ||
| 4757 | (autoload 'rmail-summary "rmailsum" "\ | 4758 | (autoload 'rmail-summary "rmailsum" "\ |
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 5b906719c39..13cd7c3f05e 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el | |||
| @@ -118,6 +118,7 @@ Setting this option to nil might speed up the generation of summaries." | |||
| 118 | (define-key map "<" 'rmail-summary-first-message) | 118 | (define-key map "<" 'rmail-summary-first-message) |
| 119 | (define-key map ">" 'rmail-summary-last-message) | 119 | (define-key map ">" 'rmail-summary-last-message) |
| 120 | (define-key map " " 'rmail-summary-scroll-msg-up) | 120 | (define-key map " " 'rmail-summary-scroll-msg-up) |
| 121 | (define-key map [?\S-\ ] 'rmail-summary-scroll-msg-down) | ||
| 121 | (define-key map "\177" 'rmail-summary-scroll-msg-down) | 122 | (define-key map "\177" 'rmail-summary-scroll-msg-down) |
| 122 | (define-key map "?" 'describe-mode) | 123 | (define-key map "?" 'describe-mode) |
| 123 | (define-key map "\C-c\C-n" 'rmail-summary-next-same-subject) | 124 | (define-key map "\C-c\C-n" 'rmail-summary-next-same-subject) |
diff --git a/lisp/man.el b/lisp/man.el index 93a67128de4..04abc3d4d88 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -426,6 +426,7 @@ Otherwise, the value is whatever the function | |||
| 426 | (suppress-keymap map) | 426 | (suppress-keymap map) |
| 427 | (set-keymap-parent map button-buffer-map) | 427 | (set-keymap-parent map button-buffer-map) |
| 428 | 428 | ||
| 429 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 429 | (define-key map " " 'scroll-up-command) | 430 | (define-key map " " 'scroll-up-command) |
| 430 | (define-key map "\177" 'scroll-down-command) | 431 | (define-key map "\177" 'scroll-down-command) |
| 431 | (define-key map "n" 'Man-next-section) | 432 | (define-key map "n" 'Man-next-section) |
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el index 2eb04787bea..c7a3a107078 100644 --- a/lisp/net/newst-plainview.el +++ b/lisp/net/newst-plainview.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> | 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> |
| 6 | ;; Filename: newst-plainview.el | 6 | ;; Filename: newst-plainview.el |
| 7 | ;; URL: http://www.nongnu.org/newsticker | 7 | ;; URL: http://www.nongnu.org/newsticker |
| 8 | ;; Time-stamp: "13. Mai 2011, 19:28:34 (ulf)" | 8 | ;; Time-stamp: "Mon 11-Feb-2013 20:27:11 gm on skiddaw" |
| 9 | ;; Package: newsticker | 9 | ;; Package: newsticker |
| 10 | 10 | ||
| 11 | ;; ====================================================================== | 11 | ;; ====================================================================== |
| @@ -405,6 +405,7 @@ images." | |||
| 405 | (define-key map "sx" 'newsticker-show-extra) | 405 | (define-key map "sx" 'newsticker-show-extra) |
| 406 | (define-key map "hx" 'newsticker-hide-extra) | 406 | (define-key map "hx" 'newsticker-hide-extra) |
| 407 | 407 | ||
| 408 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 408 | (define-key map " " 'scroll-up-command) | 409 | (define-key map " " 'scroll-up-command) |
| 409 | (define-key map "q" 'newsticker-close-buffer) | 410 | (define-key map "q" 'newsticker-close-buffer) |
| 410 | (define-key map "p" 'newsticker-previous-item) | 411 | (define-key map "p" 'newsticker-previous-item) |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 17802d39fa4..0974c62c56e 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -902,42 +902,76 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 902 | (defun tramp-adb-handle-start-file-process (name buffer program &rest args) | 902 | (defun tramp-adb-handle-start-file-process (name buffer program &rest args) |
| 903 | "Like `start-file-process' for Tramp files." | 903 | "Like `start-file-process' for Tramp files." |
| 904 | (with-parsed-tramp-file-name default-directory nil | 904 | (with-parsed-tramp-file-name default-directory nil |
| 905 | ;; When PROGRAM is nil, we just provide a tty. | 905 | ;; When PROGRAM is nil, we should provide a tty. This is not |
| 906 | ;; possible here. | ||
| 907 | (unless (stringp program) | ||
| 908 | (tramp-error v 'file-error "PROGRAM must be a string")) | ||
| 909 | |||
| 906 | (let ((command | 910 | (let ((command |
| 907 | (when (stringp program) | 911 | (format "cd %s; %s" |
| 908 | (format "cd %s; %s" | 912 | (tramp-shell-quote-argument localname) |
| 909 | (tramp-shell-quote-argument localname) | 913 | (mapconcat 'tramp-shell-quote-argument |
| 910 | (mapconcat 'tramp-shell-quote-argument | 914 | (cons program args) " "))) |
| 911 | (cons program args) " ")))) | ||
| 912 | (tramp-process-connection-type | 915 | (tramp-process-connection-type |
| 913 | (or (null program) tramp-process-connection-type)) | 916 | (or (null program) tramp-process-connection-type)) |
| 917 | (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer))) | ||
| 914 | (name1 name) | 918 | (name1 name) |
| 915 | (i 0)) | 919 | (i 0)) |
| 916 | (unwind-protect | 920 | |
| 917 | (save-excursion | 921 | (unless buffer |
| 918 | (save-restriction | 922 | ;; BUFFER can be nil. We use a temporary buffer. |
| 919 | (while (get-process name1) | 923 | (setq buffer (generate-new-buffer tramp-temp-buffer-name))) |
| 920 | ;; NAME must be unique as process name. | 924 | (while (get-process name1) |
| 921 | (setq i (1+ i) | 925 | ;; NAME must be unique as process name. |
| 922 | name1 (format "%s<%d>" name i))) | 926 | (setq i (1+ i) |
| 923 | (setq name name1) | 927 | name1 (format "%s<%d>" name i))) |
| 924 | ;; Set the new process properties. | 928 | (setq name name1) |
| 925 | (tramp-set-connection-property v "process-name" name) | 929 | ;; Set the new process properties. |
| 926 | (when command | 930 | (tramp-set-connection-property v "process-name" name) |
| 927 | (let* ((host (tramp-file-name-host v)) | 931 | (tramp-set-connection-property v "process-buffer" buffer) |
| 928 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))) | 932 | |
| 929 | (args (if (> (length host) 0) | 933 | (with-current-buffer (tramp-get-connection-buffer v) |
| 930 | (list "-s" host "shell" command) | 934 | (unwind-protect |
| 931 | (list "shell" command))) | 935 | ;; We catch this event. Otherwise, `start-process' could |
| 932 | (p (apply 'start-process (tramp-get-connection-name v) buffer | 936 | ;; be called on the local host. |
| 933 | (tramp-adb-program) args))) | 937 | (save-excursion |
| 934 | ;; Set sentinel and query flag for this process. | 938 | (save-restriction |
| 935 | (tramp-set-connection-property p "vector" v) | 939 | ;; Activate narrowing in order to save BUFFER |
| 936 | (set-process-sentinel p 'tramp-process-sentinel) | 940 | ;; contents. Clear also the modification time; |
| 937 | (tramp-compat-set-process-query-on-exit-flag p t) | 941 | ;; otherwise we might be interrupted by |
| 938 | ;; Return process. | 942 | ;; `verify-visited-file-modtime'. |
| 939 | p)))) | 943 | (let ((buffer-undo-list t) |
| 940 | (tramp-set-connection-property v "process-name" nil))))) | 944 | (buffer-read-only nil) |
| 945 | (mark (point))) | ||
| 946 | (clear-visited-file-modtime) | ||
| 947 | (narrow-to-region (point-max) (point-max)) | ||
| 948 | ;; We call `tramp-adb-maybe-open-connection', in | ||
| 949 | ;; order to cleanup the prompt afterwards. | ||
| 950 | (tramp-adb-maybe-open-connection v) | ||
| 951 | (widen) | ||
| 952 | (delete-region mark (point)) | ||
| 953 | (narrow-to-region (point-max) (point-max)) | ||
| 954 | ;; Send the command. | ||
| 955 | (let ((tramp-adb-prompt (regexp-quote command))) | ||
| 956 | (tramp-adb-send-command v command)) | ||
| 957 | (let ((p (tramp-get-connection-process v))) | ||
| 958 | ;; Set query flag and process marker for this | ||
| 959 | ;; process. We ignore errors, because the process | ||
| 960 | ;; could have finished already. | ||
| 961 | (ignore-errors | ||
| 962 | (tramp-compat-set-process-query-on-exit-flag p t) | ||
| 963 | (set-marker (process-mark p) (point))) | ||
| 964 | ;; Return process. | ||
| 965 | p)))) | ||
| 966 | |||
| 967 | ;; Save exit. | ||
| 968 | (if (string-match tramp-temp-buffer-name (buffer-name)) | ||
| 969 | (ignore-errors | ||
| 970 | (set-process-buffer (tramp-get-connection-process v) nil) | ||
| 971 | (kill-buffer (current-buffer))) | ||
| 972 | (set-buffer-modified-p bmp)) | ||
| 973 | (tramp-set-connection-property v "process-name" nil) | ||
| 974 | (tramp-set-connection-property v "process-buffer" nil)))))) | ||
| 941 | 975 | ||
| 942 | ;; Helper functions. | 976 | ;; Helper functions. |
| 943 | 977 | ||
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 00ef43b1a66..12510bf7fab 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -96,7 +96,8 @@ | |||
| 96 | ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1. | 96 | ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1. |
| 97 | ;; Besides `t', `nil', and integer, we use also timestamps (as | 97 | ;; Besides `t', `nil', and integer, we use also timestamps (as |
| 98 | ;; returned by `current-time') internally. | 98 | ;; returned by `current-time') internally. |
| 99 | (defvar remote-file-name-inhibit-cache nil) | 99 | (unless (boundp 'remote-file-name-inhibit-cache) |
| 100 | (defvar remote-file-name-inhibit-cache nil)) | ||
| 100 | 101 | ||
| 101 | ;; For not existing functions, or functions with a changed argument | 102 | ;; For not existing functions, or functions with a changed argument |
| 102 | ;; list, there are compiler warnings. We want to avoid them in | 103 | ;; list, there are compiler warnings. We want to avoid them in |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index bfa145ac780..0c2a0aa385a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2856,10 +2856,12 @@ the result will be a local, non-Tramp, filename." | |||
| 2856 | v 'file-error | 2856 | v 'file-error |
| 2857 | "pty association is not supported for `%s'" name)))) | 2857 | "pty association is not supported for `%s'" name)))) |
| 2858 | (let ((p (tramp-get-connection-process v))) | 2858 | (let ((p (tramp-get-connection-process v))) |
| 2859 | ;; Set query flag for this process. We ignore errors, | 2859 | ;; Set query flag and process marker for this |
| 2860 | ;; because the process could have finished already. | 2860 | ;; process. We ignore errors, because the process |
| 2861 | ;; could have finished already. | ||
| 2861 | (ignore-errors | 2862 | (ignore-errors |
| 2862 | (tramp-compat-set-process-query-on-exit-flag p t)) | 2863 | (tramp-compat-set-process-query-on-exit-flag p t) |
| 2864 | (set-marker (process-mark p) (point))) | ||
| 2863 | ;; Return process. | 2865 | ;; Return process. |
| 2864 | p)))) | 2866 | p)))) |
| 2865 | 2867 | ||
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 340b97e80bd..674d98b8dc3 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el | |||
| @@ -420,6 +420,7 @@ A prefix arg suppresses display of that buffer." | |||
| 420 | (define-key map [ down-mouse-2 ] 'cpp-push-button) | 420 | (define-key map [ down-mouse-2 ] 'cpp-push-button) |
| 421 | (define-key map [ mouse-2 ] 'ignore) | 421 | (define-key map [ mouse-2 ] 'ignore) |
| 422 | (define-key map " " 'scroll-up-command) | 422 | (define-key map " " 'scroll-up-command) |
| 423 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 423 | (define-key map "\C-?" 'scroll-down-command) | 424 | (define-key map "\C-?" 'scroll-down-command) |
| 424 | (define-key map [ delete ] 'scroll-down) | 425 | (define-key map [ delete ] 'scroll-down) |
| 425 | (define-key map "\C-c\C-c" 'cpp-edit-apply) | 426 | (define-key map "\C-c\C-c" 'cpp-edit-apply) |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index d8c39f2ddef..1e152c6d751 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -246,6 +246,7 @@ See `compilation-error-screen-columns'" | |||
| 246 | (let ((map (make-sparse-keymap))) | 246 | (let ((map (make-sparse-keymap))) |
| 247 | (set-keymap-parent map compilation-minor-mode-map) | 247 | (set-keymap-parent map compilation-minor-mode-map) |
| 248 | (define-key map " " 'scroll-up-command) | 248 | (define-key map " " 'scroll-up-command) |
| 249 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 249 | (define-key map "\^?" 'scroll-down-command) | 250 | (define-key map "\^?" 'scroll-down-command) |
| 250 | (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) | 251 | (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) |
| 251 | 252 | ||
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 0e44e5366ca..749b0b65576 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el | |||
| @@ -227,6 +227,7 @@ support." | |||
| 227 | (interactive "p") | 227 | (interactive "p") |
| 228 | (scroll-up arg))) | 228 | (scroll-up arg))) |
| 229 | (define-key map " " 'scroll-up-command) | 229 | (define-key map " " 'scroll-up-command) |
| 230 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 230 | (define-key map [delete] 'scroll-down-command) | 231 | (define-key map [delete] 'scroll-down-command) |
| 231 | (define-key map "h" 'idlwave-help-find-header) | 232 | (define-key map "h" 'idlwave-help-find-header) |
| 232 | (define-key map "H" 'idlwave-help-find-first-header) | 233 | (define-key map "H" 'idlwave-help-find-first-header) |
diff --git a/lisp/simple.el b/lisp/simple.el index 9587d3c006c..849f7dac55c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -358,6 +358,7 @@ Other major modes are defined by comparison with this one." | |||
| 358 | (suppress-keymap map) | 358 | (suppress-keymap map) |
| 359 | (define-key map "q" 'quit-window) | 359 | (define-key map "q" 'quit-window) |
| 360 | (define-key map " " 'scroll-up-command) | 360 | (define-key map " " 'scroll-up-command) |
| 361 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 361 | (define-key map "\C-?" 'scroll-down-command) | 362 | (define-key map "\C-?" 'scroll-down-command) |
| 362 | (define-key map "?" 'describe-mode) | 363 | (define-key map "?" 'describe-mode) |
| 363 | (define-key map "h" 'describe-mode) | 364 | (define-key map "h" 'describe-mode) |
diff --git a/lisp/startup.el b/lisp/startup.el index 741c5aa9b46..ad31a7a2a45 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1466,6 +1466,7 @@ Each element in the list should be a list of strings or pairs | |||
| 1466 | (suppress-keymap map) | 1466 | (suppress-keymap map) |
| 1467 | (set-keymap-parent map button-buffer-map) | 1467 | (set-keymap-parent map button-buffer-map) |
| 1468 | (define-key map "\C-?" 'scroll-down-command) | 1468 | (define-key map "\C-?" 'scroll-down-command) |
| 1469 | (define-key map [?\S-\ ] 'scroll-down-command) | ||
| 1469 | (define-key map " " 'scroll-up-command) | 1470 | (define-key map " " 'scroll-up-command) |
| 1470 | (define-key map "q" 'exit-splash-screen) | 1471 | (define-key map "q" 'exit-splash-screen) |
| 1471 | map) | 1472 | map) |
diff --git a/lisp/view.el b/lisp/view.el index 2717c915c71..f9326399a26 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -199,6 +199,7 @@ This is local in each buffer, once it is used.") | |||
| 199 | (define-key map "\C-?" 'View-scroll-page-backward) | 199 | (define-key map "\C-?" 'View-scroll-page-backward) |
| 200 | ;; (define-key map "f" 'View-scroll-page-forward) | 200 | ;; (define-key map "f" 'View-scroll-page-forward) |
| 201 | (define-key map " " 'View-scroll-page-forward) | 201 | (define-key map " " 'View-scroll-page-forward) |
| 202 | (define-key map [?\S-\ ] 'View-scroll-page-backward) | ||
| 202 | (define-key map "o" 'View-scroll-to-buffer-end) | 203 | (define-key map "o" 'View-scroll-to-buffer-end) |
| 203 | (define-key map ">" 'end-of-buffer) | 204 | (define-key map ">" 'end-of-buffer) |
| 204 | (define-key map "<" 'beginning-of-buffer) | 205 | (define-key map "<" 'beginning-of-buffer) |
| @@ -407,8 +408,8 @@ Digits provide prefix arguments. | |||
| 407 | \\[View-scroll-to-buffer-end] scroll so that buffer end is at last line of window. | 408 | \\[View-scroll-to-buffer-end] scroll so that buffer end is at last line of window. |
| 408 | SPC scroll forward \"page size\" lines. | 409 | SPC scroll forward \"page size\" lines. |
| 409 | With prefix scroll forward prefix lines. | 410 | With prefix scroll forward prefix lines. |
| 410 | DEL scroll backward \"page size\" lines. | 411 | DEL, S-SPC scroll backward \"page size\" lines. |
| 411 | With prefix scroll backward prefix lines. | 412 | With prefix scroll backward prefix lines. |
| 412 | \\[View-scroll-page-forward-set-page-size] like \\[View-scroll-page-forward] but with prefix sets \"page size\" to prefix. | 413 | \\[View-scroll-page-forward-set-page-size] like \\[View-scroll-page-forward] but with prefix sets \"page size\" to prefix. |
| 413 | \\[View-scroll-page-backward-set-page-size] like \\[View-scroll-page-backward] but with prefix sets \"page size\" to prefix. | 414 | \\[View-scroll-page-backward-set-page-size] like \\[View-scroll-page-backward] but with prefix sets \"page size\" to prefix. |
| 414 | \\[View-scroll-half-page-forward] scroll forward \"half page size\" lines. With prefix, sets | 415 | \\[View-scroll-half-page-forward] scroll forward \"half page size\" lines. With prefix, sets |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 8098a52e501..a7987120c50 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -83,6 +83,7 @@ AC_DEFUN([gl_EARLY], | |||
| 83 | AC_REQUIRE([AC_SYS_LARGEFILE]) | 83 | AC_REQUIRE([AC_SYS_LARGEFILE]) |
| 84 | # Code from module lstat: | 84 | # Code from module lstat: |
| 85 | # Code from module manywarnings: | 85 | # Code from module manywarnings: |
| 86 | # Code from module memrchr: | ||
| 86 | # Code from module mktime: | 87 | # Code from module mktime: |
| 87 | # Code from module multiarch: | 88 | # Code from module multiarch: |
| 88 | # Code from module nocrash: | 89 | # Code from module nocrash: |
| @@ -117,6 +118,7 @@ AC_DEFUN([gl_EARLY], | |||
| 117 | # Code from module stdio: | 118 | # Code from module stdio: |
| 118 | # Code from module stdlib: | 119 | # Code from module stdlib: |
| 119 | # Code from module strftime: | 120 | # Code from module strftime: |
| 121 | # Code from module string: | ||
| 120 | # Code from module strtoimax: | 122 | # Code from module strtoimax: |
| 121 | # Code from module strtoll: | 123 | # Code from module strtoll: |
| 122 | # Code from module strtoull: | 124 | # Code from module strtoull: |
| @@ -242,6 +244,12 @@ AC_DEFUN([gl_INIT], | |||
| 242 | gl_PREREQ_LSTAT | 244 | gl_PREREQ_LSTAT |
| 243 | fi | 245 | fi |
| 244 | gl_SYS_STAT_MODULE_INDICATOR([lstat]) | 246 | gl_SYS_STAT_MODULE_INDICATOR([lstat]) |
| 247 | gl_FUNC_MEMRCHR | ||
| 248 | if test $ac_cv_func_memrchr = no; then | ||
| 249 | AC_LIBOBJ([memrchr]) | ||
| 250 | gl_PREREQ_MEMRCHR | ||
| 251 | fi | ||
| 252 | gl_STRING_MODULE_INDICATOR([memrchr]) | ||
| 245 | gl_FUNC_MKTIME | 253 | gl_FUNC_MKTIME |
| 246 | if test $REPLACE_MKTIME = 1; then | 254 | if test $REPLACE_MKTIME = 1; then |
| 247 | AC_LIBOBJ([mktime]) | 255 | AC_LIBOBJ([mktime]) |
| @@ -294,6 +302,7 @@ AC_DEFUN([gl_INIT], | |||
| 294 | gl_STDIO_H | 302 | gl_STDIO_H |
| 295 | gl_STDLIB_H | 303 | gl_STDLIB_H |
| 296 | gl_FUNC_GNU_STRFTIME | 304 | gl_FUNC_GNU_STRFTIME |
| 305 | gl_HEADER_STRING_H | ||
| 297 | gl_FUNC_STRTOIMAX | 306 | gl_FUNC_STRTOIMAX |
| 298 | if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then | 307 | if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then |
| 299 | AC_LIBOBJ([strtoimax]) | 308 | AC_LIBOBJ([strtoimax]) |
| @@ -757,6 +766,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 757 | lib/lstat.c | 766 | lib/lstat.c |
| 758 | lib/md5.c | 767 | lib/md5.c |
| 759 | lib/md5.h | 768 | lib/md5.h |
| 769 | lib/memrchr.c | ||
| 760 | lib/mktime-internal.h | 770 | lib/mktime-internal.h |
| 761 | lib/mktime.c | 771 | lib/mktime.c |
| 762 | lib/openat-priv.h | 772 | lib/openat-priv.h |
| @@ -790,6 +800,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 790 | lib/stdlib.in.h | 800 | lib/stdlib.in.h |
| 791 | lib/strftime.c | 801 | lib/strftime.c |
| 792 | lib/strftime.h | 802 | lib/strftime.h |
| 803 | lib/string.in.h | ||
| 793 | lib/strtoimax.c | 804 | lib/strtoimax.c |
| 794 | lib/strtol.c | 805 | lib/strtol.c |
| 795 | lib/strtoll.c | 806 | lib/strtoll.c |
| @@ -848,6 +859,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 848 | m4/lstat.m4 | 859 | m4/lstat.m4 |
| 849 | m4/manywarnings.m4 | 860 | m4/manywarnings.m4 |
| 850 | m4/md5.m4 | 861 | m4/md5.m4 |
| 862 | m4/memrchr.m4 | ||
| 851 | m4/mktime.m4 | 863 | m4/mktime.m4 |
| 852 | m4/multiarch.m4 | 864 | m4/multiarch.m4 |
| 853 | m4/nocrash.m4 | 865 | m4/nocrash.m4 |
| @@ -877,6 +889,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 877 | m4/stdio_h.m4 | 889 | m4/stdio_h.m4 |
| 878 | m4/stdlib_h.m4 | 890 | m4/stdlib_h.m4 |
| 879 | m4/strftime.m4 | 891 | m4/strftime.m4 |
| 892 | m4/string_h.m4 | ||
| 880 | m4/strtoimax.m4 | 893 | m4/strtoimax.m4 |
| 881 | m4/strtoll.m4 | 894 | m4/strtoll.m4 |
| 882 | m4/strtoull.m4 | 895 | m4/strtoull.m4 |
diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 new file mode 100644 index 00000000000..5920f5747b7 --- /dev/null +++ b/m4/memrchr.m4 | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # memrchr.m4 serial 10 | ||
| 2 | dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation, | ||
| 3 | dnl Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | AC_DEFUN([gl_FUNC_MEMRCHR], | ||
| 9 | [ | ||
| 10 | dnl Persuade glibc <string.h> to declare memrchr(). | ||
| 11 | AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) | ||
| 12 | |||
| 13 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) | ||
| 14 | AC_CHECK_DECLS_ONCE([memrchr]) | ||
| 15 | if test $ac_cv_have_decl_memrchr = no; then | ||
| 16 | HAVE_DECL_MEMRCHR=0 | ||
| 17 | fi | ||
| 18 | |||
| 19 | AC_CHECK_FUNCS([memrchr]) | ||
| 20 | ]) | ||
| 21 | |||
| 22 | # Prerequisites of lib/memrchr.c. | ||
| 23 | AC_DEFUN([gl_PREREQ_MEMRCHR], [:]) | ||
diff --git a/m4/string_h.m4 b/m4/string_h.m4 new file mode 100644 index 00000000000..cc5fbbb32ff --- /dev/null +++ b/m4/string_h.m4 | |||
| @@ -0,0 +1,120 @@ | |||
| 1 | # Configure a GNU-like replacement for <string.h>. | ||
| 2 | |||
| 3 | # Copyright (C) 2007-2013 Free Software Foundation, Inc. | ||
| 4 | # This file is free software; the Free Software Foundation | ||
| 5 | # gives unlimited permission to copy and/or distribute it, | ||
| 6 | # with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | # serial 21 | ||
| 9 | |||
| 10 | # Written by Paul Eggert. | ||
| 11 | |||
| 12 | AC_DEFUN([gl_HEADER_STRING_H], | ||
| 13 | [ | ||
| 14 | dnl Use AC_REQUIRE here, so that the default behavior below is expanded | ||
| 15 | dnl once only, before all statements that occur in other macros. | ||
| 16 | AC_REQUIRE([gl_HEADER_STRING_H_BODY]) | ||
| 17 | ]) | ||
| 18 | |||
| 19 | AC_DEFUN([gl_HEADER_STRING_H_BODY], | ||
| 20 | [ | ||
| 21 | AC_REQUIRE([AC_C_RESTRICT]) | ||
| 22 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) | ||
| 23 | gl_NEXT_HEADERS([string.h]) | ||
| 24 | |||
| 25 | dnl Check for declarations of anything we want to poison if the | ||
| 26 | dnl corresponding gnulib module is not in use, and which is not | ||
| 27 | dnl guaranteed by C89. | ||
| 28 | gl_WARN_ON_USE_PREPARE([[#include <string.h> | ||
| 29 | ]], | ||
| 30 | [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul | ||
| 31 | strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r | ||
| 32 | strerror_r strsignal strverscmp]) | ||
| 33 | ]) | ||
| 34 | |||
| 35 | AC_DEFUN([gl_STRING_MODULE_INDICATOR], | ||
| 36 | [ | ||
| 37 | dnl Use AC_REQUIRE here, so that the default settings are expanded once only. | ||
| 38 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) | ||
| 39 | gl_MODULE_INDICATOR_SET_VARIABLE([$1]) | ||
| 40 | dnl Define it also as a C macro, for the benefit of the unit tests. | ||
| 41 | gl_MODULE_INDICATOR_FOR_TESTS([$1]) | ||
| 42 | ]) | ||
| 43 | |||
| 44 | AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], | ||
| 45 | [ | ||
| 46 | GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) | ||
| 47 | GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) | ||
| 48 | GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) | ||
| 49 | GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) | ||
| 50 | GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) | ||
| 51 | GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) | ||
| 52 | GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) | ||
| 53 | GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) | ||
| 54 | GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) | ||
| 55 | GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) | ||
| 56 | GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) | ||
| 57 | GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) | ||
| 58 | GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) | ||
| 59 | GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) | ||
| 60 | GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) | ||
| 61 | GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) | ||
| 62 | GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) | ||
| 63 | GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) | ||
| 64 | GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) | ||
| 65 | GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) | ||
| 66 | GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) | ||
| 67 | GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) | ||
| 68 | GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) | ||
| 69 | GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) | ||
| 70 | GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) | ||
| 71 | GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) | ||
| 72 | GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) | ||
| 73 | GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) | ||
| 74 | GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) | ||
| 75 | GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) | ||
| 76 | GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) | ||
| 77 | GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) | ||
| 78 | GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) | ||
| 79 | GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) | ||
| 80 | GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) | ||
| 81 | GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) | ||
| 82 | GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) | ||
| 83 | HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) | ||
| 84 | dnl Assume proper GNU behavior unless another module says otherwise. | ||
| 85 | HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) | ||
| 86 | HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) | ||
| 87 | HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) | ||
| 88 | HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) | ||
| 89 | HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) | ||
| 90 | HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) | ||
| 91 | HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) | ||
| 92 | HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) | ||
| 93 | HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) | ||
| 94 | HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) | ||
| 95 | HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) | ||
| 96 | HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) | ||
| 97 | HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) | ||
| 98 | HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) | ||
| 99 | HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) | ||
| 100 | HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) | ||
| 101 | HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) | ||
| 102 | HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) | ||
| 103 | HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) | ||
| 104 | HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) | ||
| 105 | REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) | ||
| 106 | REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) | ||
| 107 | REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) | ||
| 108 | REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) | ||
| 109 | REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) | ||
| 110 | REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) | ||
| 111 | REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) | ||
| 112 | REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) | ||
| 113 | REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) | ||
| 114 | REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) | ||
| 115 | REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) | ||
| 116 | REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) | ||
| 117 | REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) | ||
| 118 | REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) | ||
| 119 | UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) | ||
| 120 | ]) | ||
diff --git a/nt/ChangeLog b/nt/ChangeLog index b2a481354bc..1d3f7b7f49f 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-02-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * inc/ms-w32.h: Add prototype for memrchr. | ||
| 4 | |||
| 1 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 6 | ||
| 3 | Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539). | 7 | Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539). |
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index c10c4d9e02d..a74c74b4548 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -394,6 +394,9 @@ extern int sys_putenv (char *); | |||
| 394 | extern int getloadavg (double *, int); | 394 | extern int getloadavg (double *, int); |
| 395 | extern int getpagesize (void); | 395 | extern int getpagesize (void); |
| 396 | 396 | ||
| 397 | extern void * memrchr (void const *, int, size_t); | ||
| 398 | |||
| 399 | |||
| 397 | #if defined (__MINGW32__) | 400 | #if defined (__MINGW32__) |
| 398 | 401 | ||
| 399 | /* Define to 1 if the system has the type `long long int'. */ | 402 | /* Define to 1 if the system has the type `long long int'. */ |
diff --git a/src/ChangeLog b/src/ChangeLog index b3d3958853b..05737bb1194 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,29 @@ | |||
| 1 | 2013-02-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (redisplay_internal): Don't set w->region_showing to the | ||
| 4 | marker's position. | ||
| 5 | (display_line): Set w->region_showing to the value of | ||
| 6 | it->region_beg_charpos, not to -1. This fixes redisplay | ||
| 7 | optimization when cursor is moved up after M->. (Bug#13623) | ||
| 8 | (Bug#13626) | ||
| 9 | (try_scrolling): Scroll text up more if point is too close to ZV | ||
| 10 | and inside the scroll margin. This makes sure point is moved | ||
| 11 | outside the scroll margin in these cases. | ||
| 12 | |||
| 13 | * window.h (struct window): region_showing can no longer be | ||
| 14 | negative. | ||
| 15 | |||
| 1 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> | 16 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 17 | ||
| 18 | Tune by using memchr and memrchr. | ||
| 19 | * doc.c (Fsnarf_documentation): | ||
| 20 | * fileio.c (Fsubstitute_in_file_name): | ||
| 21 | * search.c (find_newline, scan_newline): | ||
| 22 | * xdisp.c (pos_visible_p, display_count_lines): | ||
| 23 | Use memchr and memrchr rather than scanning byte-by-byte. | ||
| 24 | * search.c (find_newline): Rename from scan_buffer. | ||
| 25 | Omit first arg TARGET, as it's always '\n'. All callers changed. | ||
| 26 | |||
| 3 | Clean up read_key_sequence a tiny bit more. | 27 | Clean up read_key_sequence a tiny bit more. |
| 4 | * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]: | 28 | * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]: |
| 5 | (read_key_sequence): Remove unused locals. | 29 | (read_key_sequence): Remove unused locals. |
| @@ -630,11 +630,10 @@ the same file name is found in the `doc-directory'. */) | |||
| 630 | break; | 630 | break; |
| 631 | 631 | ||
| 632 | buf[filled] = 0; | 632 | buf[filled] = 0; |
| 633 | p = buf; | ||
| 634 | end = buf + (filled < 512 ? filled : filled - 128); | 633 | end = buf + (filled < 512 ? filled : filled - 128); |
| 635 | while (p != end && *p != '\037') p++; | 634 | p = memchr (buf, '\037', end - buf); |
| 636 | /* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */ | 635 | /* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */ |
| 637 | if (p != end) | 636 | if (p) |
| 638 | { | 637 | { |
| 639 | end = strchr (p, '\n'); | 638 | end = strchr (p, '\n'); |
| 640 | 639 | ||
diff --git a/src/editfns.c b/src/editfns.c index 0f88a781b88..c5cd8b0b725 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -735,9 +735,8 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) | |||
| 735 | /* This is the ONLY_IN_LINE case, check that NEW_POS and | 735 | /* This is the ONLY_IN_LINE case, check that NEW_POS and |
| 736 | FIELD_BOUND are on the same line by seeing whether | 736 | FIELD_BOUND are on the same line by seeing whether |
| 737 | there's an intervening newline or not. */ | 737 | there's an intervening newline or not. */ |
| 738 | || (scan_buffer ('\n', | 738 | || (find_newline (XFASTINT (new_pos), XFASTINT (field_bound), |
| 739 | XFASTINT (new_pos), XFASTINT (field_bound), | 739 | fwd ? -1 : 1, &shortage, 1), |
| 740 | fwd ? -1 : 1, &shortage, 1), | ||
| 741 | shortage != 0))) | 740 | shortage != 0))) |
| 742 | /* Constrain NEW_POS to FIELD_BOUND. */ | 741 | /* Constrain NEW_POS to FIELD_BOUND. */ |
| 743 | new_pos = field_bound; | 742 | new_pos = field_bound; |
diff --git a/src/fileio.c b/src/fileio.c index 98a9b32ea91..89ad3396464 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1710,8 +1710,9 @@ those `/' is discarded. */) | |||
| 1710 | else if (*p == '{') | 1710 | else if (*p == '{') |
| 1711 | { | 1711 | { |
| 1712 | o = ++p; | 1712 | o = ++p; |
| 1713 | while (p != endp && *p != '}') p++; | 1713 | p = memchr (p, '}', endp - p); |
| 1714 | if (*p != '}') goto missingclose; | 1714 | if (! p) |
| 1715 | goto missingclose; | ||
| 1715 | s = p; | 1716 | s = p; |
| 1716 | } | 1717 | } |
| 1717 | else | 1718 | else |
| @@ -1779,8 +1780,9 @@ those `/' is discarded. */) | |||
| 1779 | else if (*p == '{') | 1780 | else if (*p == '{') |
| 1780 | { | 1781 | { |
| 1781 | o = ++p; | 1782 | o = ++p; |
| 1782 | while (p != endp && *p != '}') p++; | 1783 | p = memchr (p, '}', endp - p); |
| 1783 | if (*p != '}') goto missingclose; | 1784 | if (! p) |
| 1785 | goto missingclose; | ||
| 1784 | s = p++; | 1786 | s = p++; |
| 1785 | } | 1787 | } |
| 1786 | else | 1788 | else |
diff --git a/src/lisp.h b/src/lisp.h index 997ef458ec5..154f1ec5e5f 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3351,8 +3351,8 @@ extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, | |||
| 3351 | extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object); | 3351 | extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object); |
| 3352 | extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, | 3352 | extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3353 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 3353 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| 3354 | extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t, | 3354 | extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 3355 | ptrdiff_t *, bool); | 3355 | ptrdiff_t *, bool); |
| 3356 | extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, | 3356 | extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 3357 | EMACS_INT, bool); | 3357 | EMACS_INT, bool); |
| 3358 | extern ptrdiff_t find_next_newline (ptrdiff_t, int); | 3358 | extern ptrdiff_t find_next_newline (ptrdiff_t, int); |
diff --git a/src/region-cache.h b/src/region-cache.h index 697ae1c791f..e4c6b59ee95 100644 --- a/src/region-cache.h +++ b/src/region-cache.h | |||
| @@ -40,7 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 40 | existing data structure, and disturb as little of the existing code | 40 | existing data structure, and disturb as little of the existing code |
| 41 | as possible. | 41 | as possible. |
| 42 | 42 | ||
| 43 | So here's the tack. We add some caching to the scan_buffer | 43 | So here's the tack. We add some caching to the find_newline |
| 44 | function, so that when it searches for a newline, it notes that the | 44 | function, so that when it searches for a newline, it notes that the |
| 45 | region between the start and end of the search contained no | 45 | region between the start and end of the search contained no |
| 46 | newlines; then, the next time around, it consults this cache to see | 46 | newlines; then, the next time around, it consults this cache to see |
diff --git a/src/search.c b/src/search.c index c4ccf6c257b..c25d2441018 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -619,7 +619,7 @@ newline_cache_on_off (struct buffer *buf) | |||
| 619 | } | 619 | } |
| 620 | 620 | ||
| 621 | 621 | ||
| 622 | /* Search for COUNT instances of the character TARGET between START and END. | 622 | /* Search for COUNT newlines between START and END. |
| 623 | 623 | ||
| 624 | If COUNT is positive, search forwards; END must be >= START. | 624 | If COUNT is positive, search forwards; END must be >= START. |
| 625 | If COUNT is negative, search backwards for the -COUNTth instance; | 625 | If COUNT is negative, search backwards for the -COUNTth instance; |
| @@ -634,14 +634,14 @@ newline_cache_on_off (struct buffer *buf) | |||
| 634 | this is not the same as the usual convention for Emacs motion commands. | 634 | this is not the same as the usual convention for Emacs motion commands. |
| 635 | 635 | ||
| 636 | If we don't find COUNT instances before reaching END, set *SHORTAGE | 636 | If we don't find COUNT instances before reaching END, set *SHORTAGE |
| 637 | to the number of TARGETs left unfound, and return END. | 637 | to the number of newlines left unfound, and return END. |
| 638 | 638 | ||
| 639 | If ALLOW_QUIT, set immediate_quit. That's good to do | 639 | If ALLOW_QUIT, set immediate_quit. That's good to do |
| 640 | except when inside redisplay. */ | 640 | except when inside redisplay. */ |
| 641 | 641 | ||
| 642 | ptrdiff_t | 642 | ptrdiff_t |
| 643 | scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | 643 | find_newline (ptrdiff_t start, ptrdiff_t end, |
| 644 | ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit) | 644 | ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit) |
| 645 | { | 645 | { |
| 646 | struct region_cache *newline_cache; | 646 | struct region_cache *newline_cache; |
| 647 | ptrdiff_t end_byte = -1; | 647 | ptrdiff_t end_byte = -1; |
| @@ -656,7 +656,7 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 656 | else | 656 | else |
| 657 | { | 657 | { |
| 658 | direction = -1; | 658 | direction = -1; |
| 659 | if (!end) | 659 | if (!end) |
| 660 | end = BEGV, end_byte = BEGV_BYTE; | 660 | end = BEGV, end_byte = BEGV_BYTE; |
| 661 | } | 661 | } |
| 662 | if (end_byte == -1) | 662 | if (end_byte == -1) |
| @@ -684,7 +684,7 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 684 | 684 | ||
| 685 | /* If we're looking for a newline, consult the newline cache | 685 | /* If we're looking for a newline, consult the newline cache |
| 686 | to see where we can avoid some scanning. */ | 686 | to see where we can avoid some scanning. */ |
| 687 | if (target == '\n' && newline_cache) | 687 | if (newline_cache) |
| 688 | { | 688 | { |
| 689 | ptrdiff_t next_change; | 689 | ptrdiff_t next_change; |
| 690 | immediate_quit = 0; | 690 | immediate_quit = 0; |
| @@ -723,32 +723,32 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 723 | 723 | ||
| 724 | while (cursor < ceiling_addr) | 724 | while (cursor < ceiling_addr) |
| 725 | { | 725 | { |
| 726 | unsigned char *scan_start = cursor; | ||
| 727 | |||
| 728 | /* The dumb loop. */ | 726 | /* The dumb loop. */ |
| 729 | while (*cursor != target && ++cursor < ceiling_addr) | 727 | unsigned char *nl = memchr (cursor, '\n', ceiling_addr - cursor); |
| 730 | ; | ||
| 731 | 728 | ||
| 732 | /* If we're looking for newlines, cache the fact that | 729 | /* If we're looking for newlines, cache the fact that |
| 733 | the region from start to cursor is free of them. */ | 730 | the region from start to cursor is free of them. */ |
| 734 | if (target == '\n' && newline_cache) | 731 | if (newline_cache) |
| 735 | know_region_cache (current_buffer, newline_cache, | 732 | { |
| 736 | BYTE_TO_CHAR (start_byte + scan_start - base), | 733 | unsigned char *low = cursor; |
| 737 | BYTE_TO_CHAR (start_byte + cursor - base)); | 734 | unsigned char *lim = nl ? nl : ceiling_addr; |
| 738 | 735 | know_region_cache (current_buffer, newline_cache, | |
| 739 | /* Did we find the target character? */ | 736 | BYTE_TO_CHAR (low - base + start_byte), |
| 740 | if (cursor < ceiling_addr) | 737 | BYTE_TO_CHAR (lim - base + start_byte)); |
| 741 | { | 738 | } |
| 742 | if (--count == 0) | 739 | |
| 743 | { | 740 | if (! nl) |
| 744 | immediate_quit = 0; | 741 | break; |
| 745 | return BYTE_TO_CHAR (start_byte + cursor - base + 1); | 742 | |
| 746 | } | 743 | if (--count == 0) |
| 747 | cursor++; | 744 | { |
| 748 | } | 745 | immediate_quit = 0; |
| 746 | return BYTE_TO_CHAR (nl + 1 - base + start_byte); | ||
| 747 | } | ||
| 748 | cursor = nl + 1; | ||
| 749 | } | 749 | } |
| 750 | 750 | ||
| 751 | start = BYTE_TO_CHAR (start_byte + cursor - base); | 751 | start = BYTE_TO_CHAR (ceiling_addr - base + start_byte); |
| 752 | } | 752 | } |
| 753 | } | 753 | } |
| 754 | else | 754 | else |
| @@ -760,7 +760,7 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 760 | ptrdiff_t tem; | 760 | ptrdiff_t tem; |
| 761 | 761 | ||
| 762 | /* Consult the newline cache, if appropriate. */ | 762 | /* Consult the newline cache, if appropriate. */ |
| 763 | if (target == '\n' && newline_cache) | 763 | if (newline_cache) |
| 764 | { | 764 | { |
| 765 | ptrdiff_t next_change; | 765 | ptrdiff_t next_change; |
| 766 | immediate_quit = 0; | 766 | immediate_quit = 0; |
| @@ -794,31 +794,32 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 794 | 794 | ||
| 795 | while (cursor >= ceiling_addr) | 795 | while (cursor >= ceiling_addr) |
| 796 | { | 796 | { |
| 797 | unsigned char *scan_start = cursor; | 797 | unsigned char *nl = memrchr (ceiling_addr, '\n', |
| 798 | 798 | cursor + 1 - ceiling_addr); | |
| 799 | while (*cursor != target && --cursor >= ceiling_addr) | ||
| 800 | ; | ||
| 801 | 799 | ||
| 802 | /* If we're looking for newlines, cache the fact that | 800 | /* If we're looking for newlines, cache the fact that |
| 803 | the region from after the cursor to start is free of them. */ | 801 | the region from after the cursor to start is free of them. */ |
| 804 | if (target == '\n' && newline_cache) | 802 | if (newline_cache) |
| 805 | know_region_cache (current_buffer, newline_cache, | 803 | { |
| 806 | BYTE_TO_CHAR (start_byte + cursor - base), | 804 | unsigned char *low = nl ? nl : ceiling_addr - 1; |
| 807 | BYTE_TO_CHAR (start_byte + scan_start - base)); | 805 | unsigned char *lim = cursor; |
| 808 | 806 | know_region_cache (current_buffer, newline_cache, | |
| 809 | /* Did we find the target character? */ | 807 | BYTE_TO_CHAR (low - base + start_byte), |
| 810 | if (cursor >= ceiling_addr) | 808 | BYTE_TO_CHAR (lim - base + start_byte)); |
| 811 | { | 809 | } |
| 812 | if (++count >= 0) | 810 | |
| 813 | { | 811 | if (! nl) |
| 814 | immediate_quit = 0; | 812 | break; |
| 815 | return BYTE_TO_CHAR (start_byte + cursor - base); | 813 | |
| 816 | } | 814 | if (++count >= 0) |
| 817 | cursor--; | 815 | { |
| 818 | } | 816 | immediate_quit = 0; |
| 817 | return BYTE_TO_CHAR (nl - base + start_byte); | ||
| 818 | } | ||
| 819 | cursor = nl - 1; | ||
| 819 | } | 820 | } |
| 820 | 821 | ||
| 821 | start = BYTE_TO_CHAR (start_byte + cursor - base); | 822 | start = BYTE_TO_CHAR (ceiling_addr - 1 - base + start_byte); |
| 822 | } | 823 | } |
| 823 | } | 824 | } |
| 824 | 825 | ||
| @@ -828,8 +829,7 @@ scan_buffer (int target, ptrdiff_t start, ptrdiff_t end, | |||
| 828 | return start; | 829 | return start; |
| 829 | } | 830 | } |
| 830 | 831 | ||
| 831 | /* Search for COUNT instances of a line boundary, which means either a | 832 | /* Search for COUNT instances of a line boundary. |
| 832 | newline or (if selective display enabled) a carriage return. | ||
| 833 | Start at START. If COUNT is negative, search backwards. | 833 | Start at START. If COUNT is negative, search backwards. |
| 834 | 834 | ||
| 835 | We report the resulting position by calling TEMP_SET_PT_BOTH. | 835 | We report the resulting position by calling TEMP_SET_PT_BOTH. |
| @@ -860,9 +860,6 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte, | |||
| 860 | 860 | ||
| 861 | bool old_immediate_quit = immediate_quit; | 861 | bool old_immediate_quit = immediate_quit; |
| 862 | 862 | ||
| 863 | /* The code that follows is like scan_buffer | ||
| 864 | but checks for either newline or carriage return. */ | ||
| 865 | |||
| 866 | if (allow_quit) | 863 | if (allow_quit) |
| 867 | immediate_quit++; | 864 | immediate_quit++; |
| 868 | 865 | ||
| @@ -874,29 +871,25 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte, | |||
| 874 | ceiling = min (limit_byte - 1, ceiling); | 871 | ceiling = min (limit_byte - 1, ceiling); |
| 875 | ceiling_addr = BYTE_POS_ADDR (ceiling) + 1; | 872 | ceiling_addr = BYTE_POS_ADDR (ceiling) + 1; |
| 876 | base = (cursor = BYTE_POS_ADDR (start_byte)); | 873 | base = (cursor = BYTE_POS_ADDR (start_byte)); |
| 877 | while (1) | ||
| 878 | { | ||
| 879 | while (*cursor != '\n' && ++cursor != ceiling_addr) | ||
| 880 | ; | ||
| 881 | 874 | ||
| 882 | if (cursor != ceiling_addr) | 875 | do |
| 876 | { | ||
| 877 | unsigned char *nl = memchr (cursor, '\n', ceiling_addr - cursor); | ||
| 878 | if (! nl) | ||
| 879 | break; | ||
| 880 | if (--count == 0) | ||
| 883 | { | 881 | { |
| 884 | if (--count == 0) | 882 | immediate_quit = old_immediate_quit; |
| 885 | { | 883 | start_byte += nl - base + 1; |
| 886 | immediate_quit = old_immediate_quit; | 884 | start = BYTE_TO_CHAR (start_byte); |
| 887 | start_byte = start_byte + cursor - base + 1; | 885 | TEMP_SET_PT_BOTH (start, start_byte); |
| 888 | start = BYTE_TO_CHAR (start_byte); | 886 | return 0; |
| 889 | TEMP_SET_PT_BOTH (start, start_byte); | ||
| 890 | return 0; | ||
| 891 | } | ||
| 892 | else | ||
| 893 | if (++cursor == ceiling_addr) | ||
| 894 | break; | ||
| 895 | } | 887 | } |
| 896 | else | 888 | cursor = nl + 1; |
| 897 | break; | ||
| 898 | } | 889 | } |
| 899 | start_byte += cursor - base; | 890 | while (cursor < ceiling_addr); |
| 891 | |||
| 892 | start_byte += ceiling_addr - base; | ||
| 900 | } | 893 | } |
| 901 | } | 894 | } |
| 902 | else | 895 | else |
| @@ -905,31 +898,28 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte, | |||
| 905 | { | 898 | { |
| 906 | ceiling = BUFFER_FLOOR_OF (start_byte - 1); | 899 | ceiling = BUFFER_FLOOR_OF (start_byte - 1); |
| 907 | ceiling = max (limit_byte, ceiling); | 900 | ceiling = max (limit_byte, ceiling); |
| 908 | ceiling_addr = BYTE_POS_ADDR (ceiling) - 1; | 901 | ceiling_addr = BYTE_POS_ADDR (ceiling); |
| 909 | base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1); | 902 | base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1); |
| 910 | while (1) | 903 | while (1) |
| 911 | { | 904 | { |
| 912 | while (--cursor != ceiling_addr && *cursor != '\n') | 905 | unsigned char *nl = memrchr (ceiling_addr, '\n', |
| 913 | ; | 906 | cursor - ceiling_addr); |
| 907 | if (! nl) | ||
| 908 | break; | ||
| 914 | 909 | ||
| 915 | if (cursor != ceiling_addr) | 910 | if (++count == 0) |
| 916 | { | 911 | { |
| 917 | if (++count == 0) | 912 | immediate_quit = old_immediate_quit; |
| 918 | { | 913 | /* Return the position AFTER the match we found. */ |
| 919 | immediate_quit = old_immediate_quit; | 914 | start_byte += nl - base + 1; |
| 920 | /* Return the position AFTER the match we found. */ | 915 | start = BYTE_TO_CHAR (start_byte); |
| 921 | start_byte = start_byte + cursor - base + 1; | 916 | TEMP_SET_PT_BOTH (start, start_byte); |
| 922 | start = BYTE_TO_CHAR (start_byte); | 917 | return 0; |
| 923 | TEMP_SET_PT_BOTH (start, start_byte); | ||
| 924 | return 0; | ||
| 925 | } | ||
| 926 | } | 918 | } |
| 927 | else | 919 | |
| 928 | break; | 920 | cursor = nl; |
| 929 | } | 921 | } |
| 930 | /* Here we add 1 to compensate for the last decrement | 922 | start_byte += ceiling_addr - base; |
| 931 | of CURSOR, which took it past the valid range. */ | ||
| 932 | start_byte += cursor - base + 1; | ||
| 933 | } | 923 | } |
| 934 | } | 924 | } |
| 935 | 925 | ||
| @@ -942,7 +932,7 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte, | |||
| 942 | ptrdiff_t | 932 | ptrdiff_t |
| 943 | find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt) | 933 | find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt) |
| 944 | { | 934 | { |
| 945 | return scan_buffer ('\n', from, 0, cnt, (ptrdiff_t *) 0, 0); | 935 | return find_newline (from, 0, cnt, (ptrdiff_t *) 0, 0); |
| 946 | } | 936 | } |
| 947 | 937 | ||
| 948 | /* Like find_next_newline, but returns position before the newline, | 938 | /* Like find_next_newline, but returns position before the newline, |
| @@ -953,7 +943,7 @@ ptrdiff_t | |||
| 953 | find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt) | 943 | find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt) |
| 954 | { | 944 | { |
| 955 | ptrdiff_t shortage; | 945 | ptrdiff_t shortage; |
| 956 | ptrdiff_t pos = scan_buffer ('\n', from, to, cnt, &shortage, 1); | 946 | ptrdiff_t pos = find_newline (from, to, cnt, &shortage, 1); |
| 957 | 947 | ||
| 958 | if (shortage == 0) | 948 | if (shortage == 0) |
| 959 | pos--; | 949 | pos--; |
diff --git a/src/window.h b/src/window.h index 0f4f242641e..dcef37abb4c 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -338,8 +338,7 @@ struct window | |||
| 338 | int vscroll; | 338 | int vscroll; |
| 339 | 339 | ||
| 340 | /* If we have highlighted the region (or any part of it), the mark | 340 | /* If we have highlighted the region (or any part of it), the mark |
| 341 | position or -1 (the latter is used by the iterator for internal | 341 | (region start) position; otherwise zero. */ |
| 342 | purposes); otherwise zero. */ | ||
| 343 | ptrdiff_t region_showing; | 342 | ptrdiff_t region_showing; |
| 344 | 343 | ||
| 345 | /* Z_BYTE - buffer position of the last glyph in the current matrix of W. | 344 | /* Z_BYTE - buffer position of the last glyph in the current matrix of W. |
diff --git a/src/xdisp.c b/src/xdisp.c index 2e357a6e321..df0d55566e8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1397,21 +1397,9 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1397 | Lisp_Object cpos = make_number (charpos); | 1397 | Lisp_Object cpos = make_number (charpos); |
| 1398 | Lisp_Object spec = Fget_char_property (cpos, Qdisplay, Qnil); | 1398 | Lisp_Object spec = Fget_char_property (cpos, Qdisplay, Qnil); |
| 1399 | Lisp_Object string = string_from_display_spec (spec); | 1399 | Lisp_Object string = string_from_display_spec (spec); |
| 1400 | int newline_in_string = 0; | 1400 | bool newline_in_string |
| 1401 | 1401 | = (STRINGP (string) | |
| 1402 | if (STRINGP (string)) | 1402 | && memchr (SDATA (string), '\n', SBYTES (string))); |
| 1403 | { | ||
| 1404 | const char *s = SSDATA (string); | ||
| 1405 | const char *e = s + SBYTES (string); | ||
| 1406 | while (s < e) | ||
| 1407 | { | ||
| 1408 | if (*s++ == '\n') | ||
| 1409 | { | ||
| 1410 | newline_in_string = 1; | ||
| 1411 | break; | ||
| 1412 | } | ||
| 1413 | } | ||
| 1414 | } | ||
| 1415 | /* The tricky code below is needed because there's a | 1403 | /* The tricky code below is needed because there's a |
| 1416 | discrepancy between move_it_to and how we set cursor | 1404 | discrepancy between move_it_to and how we set cursor |
| 1417 | when the display line ends in a newline from a | 1405 | when the display line ends in a newline from a |
| @@ -13317,8 +13305,6 @@ redisplay_internal (void) | |||
| 13317 | ++clear_image_cache_count; | 13305 | ++clear_image_cache_count; |
| 13318 | #endif | 13306 | #endif |
| 13319 | 13307 | ||
| 13320 | w->region_showing = XINT (Fmarker_position (BVAR (XBUFFER (w->buffer), mark))); | ||
| 13321 | |||
| 13322 | /* Build desired matrices, and update the display. If | 13308 | /* Build desired matrices, and update the display. If |
| 13323 | consider_all_windows_p is non-zero, do it for all windows on all | 13309 | consider_all_windows_p is non-zero, do it for all windows on all |
| 13324 | frames. Otherwise do it for selected_window, only. */ | 13310 | frames. Otherwise do it for selected_window, only. */ |
| @@ -14679,14 +14665,24 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 14679 | else | 14665 | else |
| 14680 | { | 14666 | { |
| 14681 | struct text_pos scroll_margin_pos = startp; | 14667 | struct text_pos scroll_margin_pos = startp; |
| 14668 | int y_offset = 0; | ||
| 14682 | 14669 | ||
| 14683 | /* See if point is inside the scroll margin at the top of the | 14670 | /* See if point is inside the scroll margin at the top of the |
| 14684 | window. */ | 14671 | window. */ |
| 14685 | if (this_scroll_margin) | 14672 | if (this_scroll_margin) |
| 14686 | { | 14673 | { |
| 14674 | int y_start; | ||
| 14675 | |||
| 14687 | start_display (&it, w, startp); | 14676 | start_display (&it, w, startp); |
| 14677 | y_start = it.current_y; | ||
| 14688 | move_it_vertically (&it, this_scroll_margin); | 14678 | move_it_vertically (&it, this_scroll_margin); |
| 14689 | scroll_margin_pos = it.current.pos; | 14679 | scroll_margin_pos = it.current.pos; |
| 14680 | /* If we didn't move enough before hitting ZV, request | ||
| 14681 | additional amount of scroll, to move point out of the | ||
| 14682 | scroll margin. */ | ||
| 14683 | if (IT_CHARPOS (it) == ZV | ||
| 14684 | && it.current_y - y_start < this_scroll_margin) | ||
| 14685 | y_offset = this_scroll_margin - (it.current_y - y_start); | ||
| 14690 | } | 14686 | } |
| 14691 | 14687 | ||
| 14692 | if (PT < CHARPOS (scroll_margin_pos)) | 14688 | if (PT < CHARPOS (scroll_margin_pos)) |
| @@ -14713,6 +14709,9 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 14713 | || IT_CHARPOS (it) < CHARPOS (scroll_margin_pos)) | 14709 | || IT_CHARPOS (it) < CHARPOS (scroll_margin_pos)) |
| 14714 | return SCROLLING_FAILED; | 14710 | return SCROLLING_FAILED; |
| 14715 | 14711 | ||
| 14712 | /* Additional scroll for when ZV was too close to point. */ | ||
| 14713 | dy += y_offset; | ||
| 14714 | |||
| 14716 | /* Compute new window start. */ | 14715 | /* Compute new window start. */ |
| 14717 | start_display (&it, w, startp); | 14716 | start_display (&it, w, startp); |
| 14718 | 14717 | ||
| @@ -14820,7 +14819,7 @@ compute_window_start_on_continuation_line (struct window *w) | |||
| 14820 | SET_TEXT_POS (start_pos, ZV, ZV_BYTE); | 14819 | SET_TEXT_POS (start_pos, ZV, ZV_BYTE); |
| 14821 | 14820 | ||
| 14822 | /* Find the start of the continued line. This should be fast | 14821 | /* Find the start of the continued line. This should be fast |
| 14823 | because scan_buffer is fast (newline cache). */ | 14822 | because find_newline is fast (newline cache). */ |
| 14824 | row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0); | 14823 | row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0); |
| 14825 | init_iterator (&it, w, CHARPOS (start_pos), BYTEPOS (start_pos), | 14824 | init_iterator (&it, w, CHARPOS (start_pos), BYTEPOS (start_pos), |
| 14826 | row, DEFAULT_FACE_ID); | 14825 | row, DEFAULT_FACE_ID); |
| @@ -19255,7 +19254,7 @@ display_line (struct it *it) | |||
| 19255 | } | 19254 | } |
| 19256 | 19255 | ||
| 19257 | /* Is IT->w showing the region? */ | 19256 | /* Is IT->w showing the region? */ |
| 19258 | it->w->region_showing = it->region_beg_charpos > 0 ? -1 : 0; | 19257 | it->w->region_showing = it->region_beg_charpos > 0 ? it->region_beg_charpos : 0; |
| 19259 | 19258 | ||
| 19260 | /* Clear the result glyph row and enable it. */ | 19259 | /* Clear the result glyph row and enable it. */ |
| 19261 | prepare_desired_row (row); | 19260 | prepare_desired_row (row); |
| @@ -21731,31 +21730,36 @@ display_count_lines (ptrdiff_t start_byte, | |||
| 21731 | ceiling = min (limit_byte - 1, ceiling); | 21730 | ceiling = min (limit_byte - 1, ceiling); |
| 21732 | ceiling_addr = BYTE_POS_ADDR (ceiling) + 1; | 21731 | ceiling_addr = BYTE_POS_ADDR (ceiling) + 1; |
| 21733 | base = (cursor = BYTE_POS_ADDR (start_byte)); | 21732 | base = (cursor = BYTE_POS_ADDR (start_byte)); |
| 21734 | while (1) | 21733 | |
| 21734 | do | ||
| 21735 | { | 21735 | { |
| 21736 | if (selective_display) | 21736 | if (selective_display) |
| 21737 | while (*cursor != '\n' && *cursor != 015 && ++cursor != ceiling_addr) | 21737 | { |
| 21738 | ; | 21738 | while (*cursor != '\n' && *cursor != 015 |
| 21739 | && ++cursor != ceiling_addr) | ||
| 21740 | continue; | ||
| 21741 | if (cursor == ceiling_addr) | ||
| 21742 | break; | ||
| 21743 | } | ||
| 21739 | else | 21744 | else |
| 21740 | while (*cursor != '\n' && ++cursor != ceiling_addr) | 21745 | { |
| 21741 | ; | 21746 | cursor = memchr (cursor, '\n', ceiling_addr - cursor); |
| 21747 | if (! cursor) | ||
| 21748 | break; | ||
| 21749 | } | ||
| 21750 | |||
| 21751 | cursor++; | ||
| 21742 | 21752 | ||
| 21743 | if (cursor != ceiling_addr) | 21753 | if (--count == 0) |
| 21744 | { | 21754 | { |
| 21745 | if (--count == 0) | 21755 | start_byte += cursor - base; |
| 21746 | { | 21756 | *byte_pos_ptr = start_byte; |
| 21747 | start_byte += cursor - base + 1; | 21757 | return orig_count; |
| 21748 | *byte_pos_ptr = start_byte; | ||
| 21749 | return orig_count; | ||
| 21750 | } | ||
| 21751 | else | ||
| 21752 | if (++cursor == ceiling_addr) | ||
| 21753 | break; | ||
| 21754 | } | 21758 | } |
| 21755 | else | ||
| 21756 | break; | ||
| 21757 | } | 21759 | } |
| 21758 | start_byte += cursor - base; | 21760 | while (cursor < ceiling_addr); |
| 21761 | |||
| 21762 | start_byte += ceiling_addr - base; | ||
| 21759 | } | 21763 | } |
| 21760 | } | 21764 | } |
| 21761 | else | 21765 | else |
| @@ -21764,35 +21768,35 @@ display_count_lines (ptrdiff_t start_byte, | |||
| 21764 | { | 21768 | { |
| 21765 | ceiling = BUFFER_FLOOR_OF (start_byte - 1); | 21769 | ceiling = BUFFER_FLOOR_OF (start_byte - 1); |
| 21766 | ceiling = max (limit_byte, ceiling); | 21770 | ceiling = max (limit_byte, ceiling); |
| 21767 | ceiling_addr = BYTE_POS_ADDR (ceiling) - 1; | 21771 | ceiling_addr = BYTE_POS_ADDR (ceiling); |
| 21768 | base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1); | 21772 | base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1); |
| 21769 | while (1) | 21773 | while (1) |
| 21770 | { | 21774 | { |
| 21771 | if (selective_display) | 21775 | if (selective_display) |
| 21772 | while (--cursor != ceiling_addr | 21776 | { |
| 21773 | && *cursor != '\n' && *cursor != 015) | 21777 | while (--cursor >= ceiling_addr |
| 21774 | ; | 21778 | && *cursor != '\n' && *cursor != 015) |
| 21779 | continue; | ||
| 21780 | if (cursor < ceiling_addr) | ||
| 21781 | break; | ||
| 21782 | } | ||
| 21775 | else | 21783 | else |
| 21776 | while (--cursor != ceiling_addr && *cursor != '\n') | 21784 | { |
| 21777 | ; | 21785 | cursor = memrchr (ceiling_addr, '\n', cursor - ceiling_addr); |
| 21786 | if (! cursor) | ||
| 21787 | break; | ||
| 21788 | } | ||
| 21778 | 21789 | ||
| 21779 | if (cursor != ceiling_addr) | 21790 | if (++count == 0) |
| 21780 | { | 21791 | { |
| 21781 | if (++count == 0) | 21792 | start_byte += cursor - base + 1; |
| 21782 | { | 21793 | *byte_pos_ptr = start_byte; |
| 21783 | start_byte += cursor - base + 1; | 21794 | /* When scanning backwards, we should |
| 21784 | *byte_pos_ptr = start_byte; | 21795 | not count the newline posterior to which we stop. */ |
| 21785 | /* When scanning backwards, we should | 21796 | return - orig_count - 1; |
| 21786 | not count the newline posterior to which we stop. */ | ||
| 21787 | return - orig_count - 1; | ||
| 21788 | } | ||
| 21789 | } | 21797 | } |
| 21790 | else | ||
| 21791 | break; | ||
| 21792 | } | 21798 | } |
| 21793 | /* Here we add 1 to compensate for the last decrement | 21799 | start_byte += ceiling_addr - base; |
| 21794 | of CURSOR, which took it past the valid range. */ | ||
| 21795 | start_byte += cursor - base + 1; | ||
| 21796 | } | 21800 | } |
| 21797 | } | 21801 | } |
| 21798 | 21802 | ||